7

Is there an event fired when all the children of a lightning component have finished loading ? I would need this to fire an event from the parent that will affect all his children and as of now, some child component have not finished loading when the parent fires the render or afterRender.

Example:

<c:parentComponent>
    <c:childComponent1 />
    <c:childComponent2 />
</c:parentComponent>
  • 2
    although not recommended unless your app is in complete isolation, have you tried aura:doneRendering ? – glls Aug 25 '17 at 15:11
  • 1
    Usually, child's afterRender method will be fired first then the parent's. When you say some child component has not finished loading are you refering to some async operation which is in progress before the parent's renderer events fire? – Praveen Aug 25 '17 at 19:19
  • This component will be used inside a visualForce page through Lightning out. On some case, yes the child component will have to load async data. – Cyril Detrain Aug 25 '17 at 20:14
  • 1
    I ran into something like this. I fired an event from child's init method to let parent know that child component is loaded. Once that event is received on the parent, it would fire another event to child to send the actual data. – javanoob Aug 28 '17 at 0:55
  • Depends what you mean by loaded. Did you mean Rendered? Did you mean created? What would you do with this information? – Kris Gray Aug 15 '18 at 0:14
-1

Try using this:

<aura:handler event="aura:doneWaiting" action="{!c.callMethodAfterChildrenGetsLoaded}"/>
| improve this answer | |
  • -1 as mentioned event is deprecated – Raul Nov 8 '18 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.