node-datatable
node-datatable copied to clipboard
Counts for total and filtered are the same
When using DataTables "search" input field, node-datatable correctly builds 2 count queries (recordsTotal
and recordsFiltered
).
However, those 2 queries are always identical.
Live demo: https://plnkr.co/edit/PZiw9h5z0AgqSAQIfcXM?p=preview
It seems that the buildCountStatement
private function always uses the search string through the buildWherePartial
private function:
https://github.com/jpravetz/node-datatable/blob/ca25ef76b94743ee8101320baae37615797676db/lib/builder.js#L81-L87
It looks like previously the search string had to be explicitly provided to produce a different result: https://github.com/jpravetz/node-datatable/blob/ca25ef76b94743ee8101320baae37615797676db/lib/builder.js#L77-L78