Spinner
<!-- spinner Start --> <aura:attribute name="isLoading" type="Boolean" default="false" />
<aura:if isTrue="{!v.isLoading}"> <div class="demo-only" style="height:6rem"> <div class="slds-spinner_container"> <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand"> <span class="slds-assistive-text">Loading</span> <div class="slds-spinner__dot-a"></div> <div class="slds-spinner__dot-b"></div> </div> </div> </div> </aura:if> <!-- spinner end --> |
Model pop up
<!-- Model pop Start --> <section aria-describedby="modal-content-id-1" aria-labelledby="modal-heading-01" aria-modal="true" class="slds-modal slds-fade-in-open slds-modal_medium" role="dialog" tabindex="-1"> <div class="slds-modal__container"> <header class="slds-modal__header"> <lightning:buttonicon alternativetext="close" class="slds-modal__close" iconname="utility:close" onclick="{! c.hideModel }" variant="bare-inverse"> <h2 class="slds-modal__title slds-hyphenate" id="modal-heading-01">Modal header</h2> </lightning:buttonicon></header> <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1"> <lightning:card footer="Card Footer" title="Hello"> <aura:set attribute="actions"> <lightning:button label="New"> </lightning:button></aura:set> <p class="slds-p-horizontal_small"> Card Body (custom component) </p> </lightning:card> </div> <footer class="slds-modal__footer"> <button class="slds-button slds-button_neutral">Cancel</button> <button class="slds-button slds-button_brand">Save</button> </footer> </div> </section> <div class="slds-backdrop slds-backdrop_open"></div> <!-- Model pop End --> |
Common Helper methods
({ actionMethod : function(cmp,action){ return new Promise(function (resolve, reject) { action.setCallback(this, function (response) { //alert(response.getState()); if (response.getState() === 'SUCCESS') { resolve(response.getReturnValue()); } else if(response.getState() === 'ERROR') { reject(response.getError()); } }); // if an action isn't getting called you probably missed this line $A.enqueueAction(action); }); }, showToast : function(type, title, message, duration, mode, key) { var toastEvent = $A.get("e.force:showToast"); toastEvent.setParams({ "title": title, "message": message, "type": type, "duration": duration, "mode": mode, "key": key }); toastEvent.fire(); }, }) |
Close Quick Action
$A.get('e.force:refreshView').fire(); var dismissActionPanel = $A.get('e.force:closeQuickAction'); dismissActionPanel.fire(); |
No comments:
Post a Comment