jQuery移动主题无法正常工作 [英] Jquery mobile theme is not working
本文介绍了jQuery移动主题无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在通过使用jquery在ul上动态添加LI,但是jquery移动主题未应用.
I'm adding LI dynamically on a ul by using jquery but the jquery mobile theme is not applying.
这是我的代码
$('#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();
});
这是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.
推荐答案
将项目添加到列表视图时,必须调用refresh()方法来更新所添加项目的样式.
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.
例如:
$('#org').listview('refresh');
让我知道它是否有效.
谢谢
这篇关于jQuery移动主题无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文