-
-
Save forcetrekker/26fd194a0e505760913e9119e33a9efa to your computer and use it in GitHub Desktop.
How to create a custom rerender on a lightning component bundle? 213376
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
<aura:component description="TestChild"> | |
<aura:registerEvent name="fromModal" type="c:Event_213329"/> | |
This is for testing | |
<lightning:button label="Call Parent" | |
onclick="{!c.callParent}" /> | |
</aura:component> |
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
({ | |
callParent: function (component, event, helper) { | |
var evt = component.getEvent('fromModal') | |
.setParams({ | |
"message" : "A component event fired me. " + | |
"It all happened so fast. Now, I'm here!" }) | |
.fire(); | |
} | |
}); |
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
<aura:event type="Component" description="Event template"> | |
<aura:attribute name="message" type="String"/> | |
</aura:event> |
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
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:appHostable,force:hasRecordId"> | |
<aura:handler name="fromModal" event="c:Event_213329" | |
action="{!c.fromModal}" /> | |
<aura:attribute name="message" type="String"/> | |
<lightning:button label="ShowModal" | |
onclick="{!c.showModal}" /> | |
<hr/> | |
message: {!v.message} | |
<lightning:overlayLibrary aura:id="overlayLib"/> | |
</aura:component> |
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
({ | |
showModal: function (component, event, helper) { | |
$A.createComponent("c:Child_213329", { | |
"fromModal": component.getReference("c.fromModal") | |
}, | |
function(content, status, error) { | |
if (status === "SUCCESS") { | |
component.find('overlayLib').showCustomModal({ | |
header: "Child", | |
body: content, | |
showCloseButton: true | |
}); | |
} else { | |
throw new Error(error); | |
} | |
}); | |
}, | |
fromModal: function (component, event, helper) { | |
var message = event.getParam("message"); | |
console.log('message from modal', message); | |
component.set("v.message", message); | |
}, | |
genericCalled: function (component, event, helper) { | |
alert("genericCalled"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment