jQuery Mobile 中的动态 A 到 Z 内容列表
我希望在 jQuery Mobile 中构建一个 A 到 Z 的内容列表,其中数据被动态读取和分组。这可能吗?
我想要这样的东西从他们的文档(静态的)中动态分组:http://jquerymobile.com/demos/1.0a4.1/#docs/lists/lists-divider.html
但真正很棒的是如果我可以让分组包含可折叠的内容...
有什么想法、示例或资源吗?
I'm looking to build an A to Z content list in jQuery Mobile where data is read and grouped dynamically. Is this possible?
I want something like this grouped dynamically from their documentation (which is static):http://jquerymobile.com/demos/1.0a4.1/#docs/lists/lists-divider.html
But what would be really awesome is if I could get the grouping to be with collapsible content...
Any thoughts, examples, or resources out there?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
列表分隔符本身就是 jQuery mobile 中的一个列表项。您可能需要手动完成(按字母顺序将内容插入列表中,并为每个字母放入列表分隔符
)。是的,将点击处理程序放在列表分隔符上,使它们显示和隐藏其下的所有
然后在 A 的列表分隔符上附加一个点击处理程序,使其隐藏具有类“a”的所有
。但是您必须手动生成它,直到有人编写一个插件来将对象转换为 JQM 列表(如果它尚不存在)。
A list divider is itself a list item in jQuery mobile. You'd probably need to do it by hand (insert things into the list alphabetically and put in a list divider
<li>
for each letter). And yeah, put click handlers on the list dividers to make them show and hide all the<li>
s under them. So you're aiming for a list structure like:And then attach a click handler on the list divider for A to make it hide all
<li>
s with the class "a". But you will have to generate it by hand, till someone writes a plugin to convert an object into a JQM list, if it doesn't exist already.