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

How to "re-parse" after dynamic changes?

2 Answers 54 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Zack
Top achievements
Rank 1
Zack asked on 08 Apr 2014, 06:57 PM
Lets say I have a listview, and I wish to dynamically add a row to by inserting an <li> to the existing list <ul> using JavaScript.  The new row will not have the styling to mimic the mobile application, it looks like a plain <li> stuck in the middle of the list.

I understand why this problem happens, because the CSS classes are dynamically added to the plain HTML when the page loads.  But, is there a way to tell Kendo UI Mobile's JavaScript to "re-parse" the HTML to style up any dynamic additions to the HTML?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Ryan
Top achievements
Rank 1
answered on 09 Apr 2014, 08:15 PM
Yes, do:

kendo.mobile.init($('#newElementID'));
0
Petyo
Telerik team
answered on 10 Apr 2014, 08:32 AM
Hello Zack,

This is correct - kendo.mobile.init does the trick. In addition to the kendo.mobile.init, you can use the ListView append/prepend API

Regards,
Petyo
Telerik
 
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
Zack
Top achievements
Rank 1
Answers by
Ryan
Top achievements
Rank 1
Petyo
Telerik team
Share this question
or