Check all with jquery ui
Check all with jquery ui
Hello,
I have the jquery set up and select all of the column to disabled the rest of checkboxes when one in the column is selected all with jQuery ui button. But the issue I am having is that it doesn't select the other column data in pagination. How can I get that to work?
This is my jquery:
[code]
var table = $('table').dataTable();
$(".checkbox").click(function(){
var $_this = $(this),
tbl = $_this.closest("table"),
colIndex = $_this.closest("tr").children().index($_this.closest("td")) + 1;
if($_this.is(':checked')) {
tbl.find("td:nth-child("+colIndex+") input:checkbox", table.fnGetNodes()).not(':checked').prop("disabled", true).button({disabled:true});
} else {
tbl.find("td:nth-child("+colIndex+") input:checkbox", table.fnGetNodes()).not(':checked').prop("disabled", false).button({disabled:false});
}
[/code]
Any help would be greatly appreciated.
I have the jquery set up and select all of the column to disabled the rest of checkboxes when one in the column is selected all with jQuery ui button. But the issue I am having is that it doesn't select the other column data in pagination. How can I get that to work?
This is my jquery:
[code]
var table = $('table').dataTable();
$(".checkbox").click(function(){
var $_this = $(this),
tbl = $_this.closest("table"),
colIndex = $_this.closest("tr").children().index($_this.closest("td")) + 1;
if($_this.is(':checked')) {
tbl.find("td:nth-child("+colIndex+") input:checkbox", table.fnGetNodes()).not(':checked').prop("disabled", true).button({disabled:true});
} else {
tbl.find("td:nth-child("+colIndex+") input:checkbox", table.fnGetNodes()).not(':checked').prop("disabled", false).button({disabled:false});
}
[/code]
Any help would be greatly appreciated.
This discussion has been closed.
Replies