插入jQuery模板后,jQuery Mobile不呈现列表 [英] jquery mobile does not render list after jquery template was inserted
问题描述
我正在使用jquery模板向
I am adding
推荐答案
jQM文档:
更新列表:如果将项目添加到列表视图,则需要在其上调用
refresh()
方法以更新样式并创建任何嵌套的 添加的列表.例如:
Updating lists If you add items to a listview, you'll need to call the
refresh()
method on it to update the styles and create any nested lists that are added. For example:
$('#mylist').listview('refresh');
请注意,refresh()
方法仅影响附加到节点的新节点.
列表.出于性能原因执行此操作.已经有任何清单项目
增强功能将被刷新过程忽略.这意味着
您可以更改已经增强的列表中的内容或属性
项目,这些将不会得到反映.如果您要更新列表项,
在调用刷新之前,将其替换为新鲜的标记.
Note that the refresh()
method only affects new nodes appended to a
list. This is done for performance reasons. Any list items already
enhanced will be ignored by the refresh process. This means that if
you change the contents or attributes on an already enhanced list
item, these won't be reflected. If you want a list item to be updated,
replace it with fresh markup before calling refresh.
这篇关于插入jQuery模板后,jQuery Mobile不呈现列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!