The afterRender() function enables you to interact with the DOM tree after the framework’s rendering service has inserted DOM elements. It's not necessarily the final call in the rendering lifecycle; it's simply called after render() and it doesn't return a value.
You generally want to extend default after rendering by calling superAfterRender() function before you add your custom code.
Create ReRender component available in right side panel.
This code outlines a custom afterRender() function.
Create ReRender component available in right side panel.
This code outlines a custom afterRender() function.
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
({ | |
afterRender: function (component, helper) { | |
this.superAfterRender(); | |
// interact with the DOM here | |
var appEvent = $A.get("e.c:Event"); | |
appEvent.setParams({index: 2}); | |
appEvent.fire(); | |
helper.setPageMinHeight(); | |
} | |
}) |
This is how it looks like:
Comments
Post a Comment