I have a parent list (ul-li), while clicking the li from the list i am creating the new child list and adding it to a new page. I am getting the proper Jquery mobile's listview for child list for first time alone, if i click the same li or some other li from parent list, child list loading with out the JQM's listview widget. instead it is loading the normal list.
Please find the Jsfiddle link - http://jsfiddle.net/gopijsf/BG2ZV/1/
HTML:
<div data-role="page" id="parentPage">
<header data-role="header" data-theme="d">
<h3>Parent</h3>
</header>
<div>
<ul id="sectionUlContainer" data-role="listview">
<li><a href="#" class="sectionItemClass">List1</a></li>
<li><a href="#" class="sectionItemClass">List2</a></li>
<li><a href="#" class="sectionItemClass">List3</a></li>
<li><a href="#" class="sectionItemClass">List4</a></li>
</ul>
</div>
<footer data-role="footer" data-position="fixed" data-theme="b">
<h3></h3>
</footer>
</div>
<div data-role="page" id="childPage">
<header data-role="header" data-theme="d">
<h3>Child</h3>
<a href="#parentPage">Back</a>
</header>
<div id="childList"></div>
</div>
JS:
$(document).ready(function(){
$('.sectionItemClass').click(function(){
var childWidget = '<ul id="childUlContainer" data-role="listview"><li>childList</li></ul>';
$('#childList').html(childWidget);
$.mobile.changePage('#childPage',{transition:'slide'});
});
});
Help me how to reload JQM's listview each time. Thanks in Advance.