找回密码
 FreeOZ用户注册
查看: 1441|回复: 3
打印 上一主题 下一主题

[学习深造] jquery mobile listview

[复制链接]
跳转到指定楼层
1#
发表于 3-2-2015 12:33:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?FreeOZ用户注册

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

使用道具 举报

2#
发表于 3-2-2015 13:21:43 | 只看该作者
没有初始化listview。listview()会创建一个instance,然后在这个instance上,你call "refresh"这个方法。
一般,$(<selector>)找到instance再call
回复  

使用道具 举报

3#
发表于 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" );
回复  

使用道具 举报

4#
 楼主| 发表于 4-2-2015 04:42:59 | 只看该作者
mason00 发表于 3-2-2015 14:21
没有初始化listview。listview()会创建一个instance,然后在这个instance上,你call "refresh"这个方法。
...

谢谢
回复  

使用道具 举报

您需要登录后才可以回帖 登录 | FreeOZ用户注册

本版积分规则

小黑屋|手机版|Archiver|FreeOZ论坛

GMT+10, 27-4-2025 10:34 , Processed in 0.020527 second(s), 19 queries , Gzip On, Redis On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表