ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on March 21, 2018, 08:37:23 pm
-
Trying to use remote filtering, get error:
Notice: Trying to get property 'mode' of non-object in
in deSerializeFilter function in PHP part.
Used sample from https://paramquery.com/pro/demos/filter_header
Any idea what could be wrong?
-
Error implies that $filterObj is not an object.
you might need to check value of $pq_filter and $filterObj
-
Seems to be the same:
public static function deSerializeFilter($pq_filter)
{
// value of $pq_filter: {"mode":"AND","data":[{"dataIndx":"name","value":"test","condition":"contain","dataType":"string","cbFn":""}]}
$filterObj = json_decode(json_encode($pq_filter), FALSE);
// value of $filterObj: {"mode":"AND","data":[{"dataIndx":"name","value":"test","condition":"contain","dataType":"string","cbFn":""}]}
...
-
Solved, had wrong syntax in SQL statement.
-
Another question, when grid is filtred the records count etc doesn't seem to be auto updated when using remote data like when you use local data.
How can I adjust this?
-
Assuming you mean remote filtering without remote paging, it's straightforward
var count = grid.getData().length
or
var count = grid.option('dataModel.data').length
-
I use both remote paging and filtering, but can't get the records count at the bottom to change when you filter the data, 1 to 10 of 100 items...
-
In case of remote paging, grid doesn't know the total records.
Hence it's important to return totalRecords in json response from remote script.
-
Thanks, solved.