How to select all table rows (ajax)
How to select all table rows (ajax)
Jenstel
Posts: 14Questions: 4Answers: 0
Hi.
I'm use ajax for datatable. How to select all table row?
$(table.rows( {search:'applied'} ).nodes()).addClass('active');
- selected only rows in curent page
This discussion has been closed.
Answers
try $(table.rows( {search:'applied'} ).select();
Not working
it works for me. http://jsbin.com/yifofu/edit?html,js,output
I put "ai" in the search box, clicked on the select all button.
The event handler for the button applied what is above and selected all rows.
I cleared the search box, to see what was selected and was not on multiple pages.
I'm using
$('#btn_allSelect').on("click", function(){
table.rows({search:'applied'}).select();
});
and
my.js:134 Uncaught TypeError: table.rows(...).select is not a function
@bindrid has enabled "select":
Have you?
thank you @tangerine, I meant to ask him that and that the select extenstion js and css files were included.
Help. I'm doing that
var table = $('#example').DataTable( {
data:dataset.data,
select:"multi",
"columns": myColumns
} );
but
my.js:135 Uncaught TypeError: table.rows(...).select is not a function*
Since the basic concept works as shown in my link, we are actually going to need to see more of your code, particularly your includes (both css and js) so we can figure out what is going on.
https://datatables.net/manual/tech-notes/10 DataTables debugger provides information that we can use to figure out what is going on