Get row count from filter without using redraw.
Get row count from filter without using redraw.
LanFeusT23
Posts: 4Questions: 0Answers: 0
Hey,
I'm trying to get the count of rows based on a filter without changing the display on the table, for stats purposes.
I've tried this:
$("#datatable").fnSettings().aoPreSearchCols[1].sSearch = "blablabla";
However I'm unable to get the proper count of rows that this filter would generate without first doing a $("#datatable").fnDraw() but at that point it redraws my table which I don't want.
The idea is that I have a table with tabs that act as filters on a hidden Status column. However I want to be able to calculate how many rows there are for each status before the user clicks on them. So that it would show "Active (12), Done (2)" for example. it's set on page load from our server, but since the items can change status we end up with columns that have incorrect counts until the next page refresh.
Any ideas?
Thanks
I'm trying to get the count of rows based on a filter without changing the display on the table, for stats purposes.
I've tried this:
$("#datatable").fnSettings().aoPreSearchCols[1].sSearch = "blablabla";
However I'm unable to get the proper count of rows that this filter would generate without first doing a $("#datatable").fnDraw() but at that point it redraws my table which I don't want.
The idea is that I have a table with tabs that act as filters on a hidden Status column. However I want to be able to calculate how many rows there are for each status before the user clicks on them. So that it would show "Active (12), Done (2)" for example. it's set on page load from our server, but since the items can change status we end up with columns that have incorrect counts until the next page refresh.
Any ideas?
Thanks
This discussion has been closed.