Row count of filtered rows
Row count of filtered rows
jacomo
Posts: 2Questions: 2Answers: 0
Hello, I need to count the rows displayed after filtering the table, I am using the page.info api but I always get the same number for displayed with the total rows.
var info = table1.page.info();
var rowstot = info.recordsTotal;
var rowsshown = info.recordsDisplay;
Is it a bug maybe? Thank you
This discussion has been closed.
Answers
Hi, I tried this code and it worked perfectly fine:
And this is my table footer:
Showing 1 to 1 of 1 entries (filtered from 2 total entries) Click row to select
Hence 1 was being alerted as rowsshown and 2 as rowstot.
Something else must be wrong with your code. You might initialize rowstot and rowsshown too early, before the filter is being applied?!
Hi @jacomo ,
Use the
recordsDisplay
as shown in this example,Cheers,
Colin