Skip to content Skip to sidebar Skip to footer

How To Get Filtered Row Count

I have been trying to get the row count of my table after filtering, but I can't even get it to respond back with the row count initially. My table is rendered via HTML5 and popula

Solution 1:

Use page.info() API method to get paging information about the table.

It returns an object, for example:

{
    "page": 1,
    "pages": 6,
    "start": 10,
    "end": 20,
    "length": 10,
    "recordsTotal": 57,
    "recordsDisplay": 57
}

Usage:

functiongetNumFilteredRows(id){
   var info = $(id).DataTable().page.info();
   return info.recordsDisplay;
}

Post a Comment for "How To Get Filtered Row Count"