Created
June 27, 2017 13:39
-
-
Save iamsonal/1810180ed1f59770e83d9e82c46cc009 to your computer and use it in GitHub Desktop.
quickAddController.js
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
/*quickAddController.js*/ | |
({ | |
clickAdd: function(component, event, helper) { | |
// Get the values from the form | |
var n1 = component.find("num1").get("v.value"); | |
var n2 = component.find("num2").get("v.value"); | |
// Display the total in a "toast" status message | |
var resultsToast = $A.get("e.force:showToast"); | |
resultsToast.setParams({ | |
"title": "Quick Add: " + n1 + " + " + n2, | |
"message": "The total is: " + (n1 + n2) + "." | |
}); | |
resultsToast.fire(); | |
// Close the action panel | |
var dismissActionPanel = $A.get("e.force:closeQuickAction"); | |
dismissActionPanel.fire(); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment