I'm adding LI dynamically on a ul by using jquery but the jquery mobile theme is not applying.
here is my code
$('#employee_list').on("click", "a", function() {
var li_id = this.id;
$("#chart").html(" ");
var title = '<li id="visited"><a href="#" data-role="button" data-inline="true">True</a>';
$("#main_child_ul").append(title);
$('#org').trigger("create");
$("#org").jOrgChart({
chartElement : '#chart',
dragAndDrop : true
});
//$("#orgger").collapsibleset();
});
and here is the html
<ul id="org" style="display:none">
<li id="visited"><a href="#" data-role="button" data-inline="true">True</a>
<ul id="main_child_ul" class="children">
</ul>
</li>
</ul>
Any help? this is adding tree nodes dynamically but theme is not applying.
When you add items to a listview, you will have to call the refresh() method to update the styles for the items which are added.
Ex:
$('#org').listview('refresh');
Let me know if it works.
Thanks
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.