How to get number of selected rows? (server-side)
How to get number of selected rows? (server-side)
culter
Posts: 102Questions: 24Answers: 0
Hi, I'm trying to get the number of selected rows, but always get 0. I have server-side processing on if that matters. I tried this code:
$(document).ready(function() {
var table = $('#dates').DataTable( {} );
var dataA = table
.rows()
.data();
console.log( "DataLength: " + dataA.length );
var info = table.page.info();
$('#tableInfo').html(
'Currently showing page '+(info.page+1)+' of '+info.pages+' pages.'
);
});
Thank you for any advice.
This discussion has been closed.
Answers
Hi @culter ,
If you're using the Responsive plugin, you can use
Cheers,
Colin
Hi Colin, thank you for the response. I turned responsive to true and tried to retrieve the count of selected rows with
but as previously I got 0.
Hi @culter ,
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin