Wait to render all child nodes

Hello,

is there a possibility to wait while component renders all his child nodes before doing something with it? Maybe there are some methods to do that?

For example I have 10 tabs and I need to know when all items with all child components/nodes are successfully rendered before doing some other actions. In ngAfterViewInit method not always all its child components are rendered. I want to wait it without using setTimeout, debounceTime or something like that where I need to hardcode waiting time.

1 Reply

AP Arun Palaniyandi Syncfusion Team June 15, 2018 09:53 AM UTC

Hi AC, 
 
Thanks for using Syncfusion Products. 
 
Query:”is there a possibility to wait while component renders all his child nodes before doing something with it? Maybe there are some methods to do that?For example I have 10 tabs and I need to know when all items with all child components/nodes are successfully rendered before doing some other actions. In ngAfterViewInit method not always all its child components are rendered. I want to wait it without using setTimeout, debounceTime or something like that where I need to hardcode waiting time.” 
 
 
Yes, it is possible to wait while component renders all his child nodes before doing something with it. For this, we suggest you to bind created event for the Tab component. This event will be fired once the component rendering is completed. So you can use this event to do your actions because all the child nodes were rendered already . Please find the below code snippets for more details. 
 

<ejs-tab id="element" #element (created)='oncreated($event)' > 
  <e-tabitems> 
    <e-tabitem [header]='headerText[0]' content="#idv1" ></e-tabitem> 
    <e-tabitem [header]='headerText[1]' content="#idv2" ></e-tabitem> 
     <e-tabitem [header]='headerText[2]' content="#idv3" ></e-tabitem>  
  </e-tabitems> 
</ejs-tab> 
  

oncreated(args) { 
   
  alert("Do your operations here") 
 
  } 



Also please find the below for your reference. 
 
 

Please check the shared details, sample and let us know if you have any further queries.     
  
Regards,  
Arun P.  


Loader.
Up arrow icon