This is a migrated thread and some comments may be shown as answers.

Knowing when a Kendo Widget is rendered

1 Answer 404 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 30 Nov 2012, 09:02 PM
I have a TabStrip that loads other Kendo content using Ajax. This dynamic content has a kendo grid on it.

After the grid is created, I need to apply a specific Filter from the main page (user clicks on a list item for the filter they want to apply).

Problem is sometimes, the grid has not been created by the time the code is called to apply the filter obviously resulting in an error.

This is a single action by the user. If the grid has not been created previously, it is created and then a filter immediately applied.
If it has been created previously, the filters work fine as the grid exists.

How can you be sure that a kendo widget is rendered. is there a callback mechanism, a wrapper function to wait before futher processing?
There is probably a fundemental way of doing this in JQuery
Thanks

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 03 Dec 2012, 03:50 PM
Hi Gary,

A Kendo UI widget is rendered after its initialization statement has been executed. In some cases the widget might use setTimeout, so using one after the intiialization statement should be sufficient.

With regard to the Grid, the widget's data will be rendered with some delay if Ajax binding is used. In this case, if you apply your customizations in the widget's dataBound event, you will be certain that everything you need will exist on the page.

The TabStrip itself has a contentLoaded event, but this will be fired before the Grid inside is initialized.

Regards,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Gary
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or