Skip to content

Instantly share code, notes, and snippets.

@SalesforceBobLightning
Created July 2, 2018 23:25
Show Gist options
  • Select an option

  • Save SalesforceBobLightning/c17c801e8972c50b759bb43e7baa86d3 to your computer and use it in GitHub Desktop.

Select an option

Save SalesforceBobLightning/c17c801e8972c50b759bb43e7baa86d3 to your computer and use it in GitHub Desktop.
Salesforce Lightning JavaScript Helper method for opening a custom modal window
openModel : function(cmp, componentName, params, modelId, header, cssClass, callback) {
var modalBody;
$A.createComponent(componentName, params,
function(content, status) {
if (status === "SUCCESS") {
modalBody = content;
cmp.find(modelId).showCustomModal({
header: header,
body: modalBody,
cssClass: cssClass,
showCloseButton: true,
closeCallback : callback
})
}
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment