Last active
May 31, 2018 18:11
-
-
Save SalesforceBobLightning/39940e85a30adb65aabb19632294e2da to your computer and use it in GitHub Desktop.
Salesforce Lightning Show Toast JavaScript Helper Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Documentation: https://developer.salesforce.com/docs/component-library/bundle/force:showToast/specification | |
// type: 'error', 'warning', 'success', or 'info' | |
showToast : function(title, message, type, icon) { | |
var toastEvent = $A.get("e.force:showToast"); | |
toastEvent.setParams({ | |
title : title, | |
message: message, | |
duration: '2000', | |
key: icon, | |
type: type, | |
mode: 'dismissible' | |
}); | |
toastEvent.fire(); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment