Add the number of total rows in sLengthMenu
Add the number of total rows in sLengthMenu
![JayCoder](https://secure.gravatar.com/avatar/88cfe7a48648e5a270f083b3659f8a70/?default=https%3A%2F%2Fvanillicon.com%2F88cfe7a48648e5a270f083b3659f8a70_200.png&rating=g&size=120)
Hi,
I'm trying to figure how to get the total number of rows in the Datatable after the "show records on page" -dropdown, like "Show [dropdown] on page (total 300)"
I saw a count example somewhere like:
var table = $('#example').DataTable();
alert( 'Rows '+table.rows( '.selected' ).count()+' are selected' );
But the problem is. my table is an aspx-gridview so my call is like this since the table is a server-control:
$(document).ready(function () {
$('#<%= ResultGrid.ClientID %>').DataTable()
I can't put ASP code in a JavaScript file
Thanks,
Jay
Answers
Hi @JayCoder ,
You could do something like this, which would probably be easiest as it keeps it all in the table initialisation.
Hope that does the trick,
Cheers,
Colin