My musings while programming in a number of languages and libraries, from PHP, Perl, JavaScript, jQuery, and KnockoutJS, with liberal use of CSS and Bootstrap to make it all pretty.
2014-02-17
jQuery DataTables: How to get total rows
Given the DataTables initialization below:
I had to get the total number of rows to display elsewhere in the page. I didn't want to rely on "Showing X to Y of Z entries", as I wanted it much higher in the page.
The solution was extremely simple:
With that little bit of code I could show the user how many records I had for them before they saw the table.
Labels:
DataTables,
jQuery
Location:
Milwaukee, WI, USA