带有多个复选框列的GridView并选择所有列标题
我在标题中使用asp.net gridview我有两列
column select all employee | column select all employer
所以我有两个列的两个复选框,所以一旦它点击选择所有员工,它应该只为所有员工选择,同样与雇主一起
但如果只选择雇主,以下代码选择雇员和雇主。
function SelectAllCheckboxes(chk) { $('#').find("input:checkbox").each(function () { if (this != chk) { this.checked = chk.checked; } }); } function SelectAllCheckboxes1(chk) { $('#').find("input:checkbox").each(function () { if (this != chk) { this.checked = chk.checked; } }); }
ASP – 在您的GridView中:
ASP – “全选”复选框:
jQuery的
function SelectAllCheckboxes(chk, selector) { $('#<%=gv.ClientID%>').find(selector + " input:checkbox").each(function () { $(this).prop("checked", $(chk).prop("checked")); }); }