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 enter image description here

console enter image description here

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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -