jquery mobile listview is not displaying for the dynamic content for second time -
i have ul-li list(say parent list), on clicking of each li parent creating 1 more ul-li list(say child list) dynamically. problem is, jqm's listview template child list loading first click parent list. not loading if click same li or other li parent, instead loading normal html ul-li list not jqm's list.
sample code,
html:
<ul id="parentulcontainer" data-role="listview"> <li id="one">first<li> <li id="two">second<li> </ul>
script:
$("#parentulcontainer li").click(function(){ //creating dynamic child ul-li list respect #one or #two of parent. });
i don't know how use , use listview's refresh method. kindly suggest me.
i think problem here list view needs refreshed in js after add new list item
$( "#parentulcontainer" ).listview( "refresh" );
i have created jsfiddle example usage: http://jsfiddle.net/ajpalma/n9dsg/
i noticed closing list items missing leading "/" , fixed in fiddle.
Comments
Post a Comment