javascript - Bootstrap Switch in Datagrid -
im rendering datagrid in asp.net vb, want incorporate bootstrap switch, can target 1 row
html:
<asp:templatecolumn headertext="allow text" itemstyle-width="1px" headerstyle-width="1px"> <itemtemplate> <asp:checkbox id="cbtxt" runat="server" checked='<%# container.dataitem("allowtxt")%>'/> </itemtemplate> </asp:templatecolumn>
jquery:
$("[id='contentplaceholder1_dgnames_cbtxt_1']").bootstrapswitch();
i 1 working accessing chrome developer console, when tried dropping "1" @ end, didnt work, work if have full id, , nothing more. there way around this?!
display
console
the answer question can found on here . class added <asp:checkbox>
wasnt being picked when page rendered. in reference @mark , link above, added class checkbox through jquery, before initialized bootstrap switch:
$("input[type=checkbox]").addclass("switch"); $(".switch").bootstrapswitch();
Comments
Post a Comment