我一直在玩jQuery Mobile的Table Widget。有没有办法通过此小部件从其表标题名称中设置列的显示隐藏状态?如果没有这种方法,那么解决这种问题的最佳解决方案是什么?
jQM并没有为此提供现成的解决方案,因此,您必须通过JS来实现。该拨动柱弹出继承表的id
后面-popup
。当tablecreate
事件触发更改复选框属性时,您需要将其定位。
请注意,只有thead
带有的元素data-priority
将被添加到列切换弹出窗口。此外,您将需要使用方法或选择器通过其索引来定位复选框。.eq()
:eq()
$(document).on("pagebeforecreate", "#pageID", function () {
$("#tableID").on("tablecreate", function () {
$("#tableID-popup [type=checkbox]:eq(1)") /* second checkbox */
.prop("checked", false) /* uncheck it */
.checkboxradio("refresh") /* refresh UI */
.trigger("change"); /* trigger change to update table */
});
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句