Condition to select all rows all pages
Condition to select all rows all pages

Hi guys , i'm using datatables and i have created a column with a input type checkbox
<th><input type="checkbox" id="check_all"></th>
when a check this checkbox he call a function javascript .
$(document).on('click','#check_all',function(e){
var table2 = $('.datatable').DataTable();
table2.rows({ search: 'applied' }).select();
});
this select all rows based on what i have search .
inside my datatables script i have a function render that do this .
{ data: 'sync',
'searchable': false,
'orderable':false,
'render': function (data, type, row) {
if(row.sync==1){
return '<button value=1>Send</button>';
} else{
return '<button value=0>Waiting</button>';
}
}
},
its possible to select only rows that have button value 0 or for example , select rows that have text "Waiting" ?
This discussion has been closed.
Answers
You can use the
rows()
row-selector
as a function an return only the rows you want to select. See the function example for how to do this.Kevin
hey Kth , i put this inside my check_all function
in my column 3 i search for the value '0' if true the class 'highlight' append to him . after this , only the rows with hightlight class are selected , but this dont consider the search , so the real situation must be
"class" and "search" ? its possible this combination ?
I was thinking something more like this:
Kevin