折叠所有表单项JQuery Mobile [英] Collapse all form items JQuery Mobile
问题描述
使用J Query mobile 1.4.0
Using J Query mobile 1.4.0
我的表单包含许多具有多个复选框的可扩展元素。当我单击我的刷新按钮时,我可以清除所有用户选择,但不同的字段集仍然是展开。我可以刷新页面,但我不认为这是一个平滑的选择。除了为每个字段集编写JS之外,还有一种重新加载表单或折叠所有表单元素的方法吗?
I have a form that has many expandable elements with multiple check boxes. When I click my refresh button I can clear all the users selections, however the different field sets remain expanded. I could refresh the page however I don't think that is a smooth option. Other than writing JS for each field set is there a method to reload the form or collapse all form elements?
列表视图的一个很好的例子但是这适用于单个列表。我将需要此代码应用于所有表单元素(可折叠字段集)
A good example for a list view However this is for individual lists. I will need this code to apply to all form elements (collapsible fieldsets)
推荐答案
要崩溃或以编程方式展开可折叠,使用 .collapsible()
小部件与折叠
或 expand
arguments。
To collapse or expand a collapsible programmatically, use .collapsible()
widget with collapse
or expand
arguments.
/* collapse */
$(".selector").collapsible("collapse");
/* expand */
$(".selector").collapsible("expand");
这篇关于折叠所有表单项JQuery Mobile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!