jquery - remove flexmenu attribute from a td -
<tbody id="last" data-bind="foreach: studetails.getstudentsearchmodel"> <tr> <td data-bind="text: $index()+1"></td> <td><input type="checkbox" /></td> <td data-bind="text: studid"></td> <td data-bind="trimtext: studname"></td> </tr> </tbody>
the below code add flexmeny td
var trloop = 1; $("#tblstulist tbody tr").each(function () { $(this).find('td').each(function () { $(this).addflexmenu('flexmenu' +studidarray[trloop]); // $(this).attr('nowrap', 'nowrap'); }); trloop = trloop + 1; });
how can remove flexmenu attribute check box td
<td><input type="checkbox" /></td>
in additional want add nowrap to:
<td data-bind="trimtext: studname"></td>
since other td
elements has data-bind
attributes can target td
elements
$("#tblstulist tbody tr").each(function () { $(this).find('td[data-bind]').each(function () { $(this).addflexmenu('flexmenu' + studidarray[trloop]); // $(this).attr('nowrap', 'nowrap'); }); trloop = trloop + 1; });
another option target td
position - second td
$("#tblstulist tbody tr").each(function () { $(this).find('td:not(:nth-child(2))').each(function () { $(this).addflexmenu('flexmenu' + studidarray[trloop]); // $(this).attr('nowrap', 'nowrap'); }); trloop = trloop + 1; });
or can td without input
$("#tblstulist tbody tr").each(function () { $(this).find('td:not(:has(input))').each(function () { $(this).addflexmenu('flexmenu' + studidarray[trloop]); // $(this).attr('nowrap', 'nowrap'); }); trloop = trloop + 1; });
Comments
Post a Comment