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:
|
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:
|
* @param searchString If specified then produces a statement to count the filtered list of records. |
|
* Otherwise the statement counts the unfiltered list of records. |
When using DataTables "search" input field, node-datatable correctly builds 2 count queries (
recordsTotalandrecordsFiltered).However, those 2 queries are always identical.
Live demo: https://plnkr.co/edit/PZiw9h5z0AgqSAQIfcXM?p=preview
It seems that the
buildCountStatementprivate function always uses the search string through thebuildWherePartialprivate function:node-datatable/lib/builder.js
Lines 81 to 87 in ca25ef7
It looks like previously the search string had to be explicitly provided to produce a different result:
node-datatable/lib/builder.js
Lines 77 to 78 in ca25ef7