Created
May 19, 2019 03:01
-
-
Save Sunil02kumar/e0ae624fab073db19569a2c6e3928625 to your computer and use it in GitHub Desktop.
Lightning:NotificationsLibrary : Easy Way to Display Notices in Lightning
This file contains hidden or 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
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global" > | |
<lightning:notificationsLibrary aura:id="notifLib"/> | |
<lightning:button name="notice" label="Display Notice" onclick="{!c.showNotice}"/> | |
</aura:component> |
This file contains hidden or 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
({ | |
//available variant values are info, warning, and error. This value defaults to info. | |
showNotice : function(component, event, helper) { | |
component.find('notifLib').showNotice({ | |
"variant": "error", | |
"header": "An Internal Server has occured!", | |
"message": "There was a problem updating the record. Please contact your system administrator.", | |
closeCallback: function() { | |
$A.get('e.force:refreshView').fire(); | |
} | |
}); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment