We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Does not generate instance when added to a tab

Hello I have a problem when using MultiSelect Dropdown along with one tab the component is on the second tab, but it does not generate a valid instance. when the field comes into focus then the field is instantiated

I customized an example from
https://ej2.syncfusion.com/angular/demos/#/material/multi-select/checkbox

and follows in custom attachment.

Attachment: mlja32.run_74932b47.zip

5 Replies

VK Vinoth Kumar Sundara Moorthy Syncfusion Team July 31, 2019 01:37 PM UTC

Hi Adriano, 
 
Thank you for contacting Syncfusion support. 
 
We can get the instance of the control once it is rendered completely. In Tab component, the contents of each tab are rendered when we open the respective tab item. Hence we can able to get the instance at the `created` event with usage of ‘setTimeOut()’ will get rid of this issue. 
 
Modified Sample Link: 
 
Could you please check the above sample and get back to us of you need any further assistance on this? 
 
Regards, 
Vinoth Kumar S 



AN Adriano Nascimento July 31, 2019 02:33 PM UTC

Hello Vinoth Kumar,

I understand that when clicking on the tab he should create the element, but this behavior is only for this control, I use other components and even grid on other tabs being instantiated correctly, I can even manipulate / configure even with focus on the first first tab or I have not even clicked on others, because in my case I can not be sure if the user will do this action but I need to load information from a valid instance to manipulate the control.

perhaps there is a previous loading of the controls in another tab or this loading of that specific control changes.
I worry if this behavior happens on other controls than this MultiSelect, so you may have to change the tab control.

I am open to suggestions.


VK Vinoth Kumar Sundara Moorthy Syncfusion Team August 1, 2019 01:15 PM UTC

Hi Adriano, 
 
Good day to you. 
 
We would like to let you know that setTimeOut is used in the source itself for components like Grid, Schedule etc. But we have not maintained it for small components like MultiSelect , Calendar etc. As we stated in our previous update using ng-template in Tab, it will take few more time to render and suggest to use setTimeOut in sample level. Could you please let us know if you have any further assistance on this? 
 
Regards, 
Vinoth Kumar S 



AN Adriano Nascimento August 2, 2019 12:02 PM UTC

Hi Vinoth

I got a great result, which works despite everything else using https://ej2.syncfusion.com/angular/documentation/tab/getting-started/#initialize-the-tab-using-html-elements
so I have no problems with loading and the instance is valid even not clicking the tab.
This is working for myself in version 17.1.49 I have not tested with the latest but I think it should work.

Thank you.


VK Vinoth Kumar Sundara Moorthy Syncfusion Team August 2, 2019 12:49 PM UTC

Hi Adriano, 
  
We are happy to hear that your issue has been resolved. Please feel free to contact us if you need any further assistance on Syncfusion components. 
  
Regards, 
Vinoth Kumar S 


Loader.
Up arrow icon