DDD888 发表于 3-2-2015 12:33:43

jquery mobile listview

我如果直接写listview("refresh")会出错,但如果我写listview().listview("refresh")就可以正常运行,我一直没搞懂我为啥要重复写两次listview?

mason00 发表于 3-2-2015 13:21:43

没有初始化listview。listview()会创建一个instance,然后在这个instance上,你call "refresh"这个方法。
一般,$(<selector>)找到instance再call

mason00 发表于 3-2-2015 13:23:13

http://api.jquerymobile.com/listview/#method-refresh

refresh()Returns: jQuery (plugin only)

update the listview.
If you manipulate a listview via JavaScript (e.g. add new LI elements), you must call the refresh method on it to update the visual styling.

This method does not accept any arguments.
Code examples:
Invoke the refresh method:

1
$( ".selector" ).listview( "refresh" );

DDD888 发表于 4-2-2015 04:42:59

mason00 发表于 3-2-2015 14:21
没有初始化listview。listview()会创建一个instance,然后在这个instance上,你call "refresh"这个方法。
...

谢谢:loveliness:
页: [1]
查看完整版本: jquery mobile listview