-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
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:
Lines 81 to 87 in ca25ef7
| function buildCountStatement(requestQuery) { | |
| var dateSql = buildDatePartial(); | |
| var result = "SELECT COUNT("; | |
| result += self.sSelectSql ? "*" : (self.sCountColumnName ? self.sCountColumnName : "id"); | |
| result += ") FROM "; | |
| result += self.sFromSql ? self.sFromSql : self.sTableName; | |
| result += buildWherePartial(requestQuery); |
It looks like previously the search string had to be explicitly provided to produce a different result:
Lines 77 to 78 in ca25ef7
| * @param searchString If specified then produces a statement to count the filtered list of records. | |
| * Otherwise the statement counts the unfiltered list of records. |
Metadata
Metadata
Assignees
Labels
No labels