javascript - How to set default value of Column-Toggle Table Widget for a column? -
javascript - How to set default value of Column-Toggle Table Widget for a column? -
i have been toying around table widget jquery mobile. there way can set show-hide status of column table header name via widget? if there no such way best solution such problem?
jqm doesn't offer out-of-the-box solution this, therefore, have through js. column toggle popup inherits table's id
followed -popup
. need target when tablecreate
event fires alter checkbox(es) property.
note thead
elements data-priority
added column toggle popup. moreover, need target checkbox(es) index using .eq()
method or :eq()
selector.
$(document).on("pagebeforecreate", "#pageid", function () { $("#tableid").on("tablecreate", function () { $("#tableid-popup [type=checkbox]:eq(1)") /* sec checkbox */ .prop("checked", false) /* uncheck */ .checkboxradio("refresh") /* refresh ui */ .trigger("change"); /* trigger alter update table */ }); });
demo
javascript table jquery-mobile widget
Comments
Post a Comment