ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on November 16, 2016, 02:28:29 pm
-
Hi, Im using:
$("#grid_array").pqGrid( "filter", { oper: 'replace', data: [
{ dataIndx: 'Column1', condition: 'equal', value: '0'},
]})
to set a filter...Would it be possible to add expression OR like 'Column1' == '0' OR 'Column2' == '0'?
-
That would be
grid.filter({
oper: 'replace',
data: [
{ dataIndx: 'Column1', condition: 'equal', value: '0'},
{ dataIndx: 'Column2', condition: 'equal', value: '0'}
]
});
and set mode = "OR" in filterModel
http://paramquery.com/pro/api#option-filterModel
-
Thanks, works fine.
Question...since I change the filterModel from default (AND) to (OR), I would like to restore after the filter is executed:
$("#grid_array").pqGrid( "option", "filterModel", { on: true, mode : "AND" } );
However this removes the filter header?
Also, regarding the filter condition...if I for the same column would like to filter on value: 1, 2 and 4...how would that looke like?
{ dataIndx: 'test', condition: 'equal', value: '0'}, // add value 1, 2 and 4...
-
$("#grid_array").pqGrid( "option", "filterModel", { on: true, mode : "AND" } );
However this removes the filter header?
use $("#grid_array").pqGrid( "option", "filterModel.mode", "AND" );
if I for the same column would like to filter on value: 1, 2 and 4...how would that looke like?
Code: [Select]
{ dataIndx: 'test', condition: 'equal', value: '0'}, // add value 1, 2 and 4...
use { dataIndx: 'test', condition: 'range', value: [1,2,4] },
-
Thanks. Is it possible to have more advanced expressions?
$("#grid_array").pqGrid("filter", {
oper: 'replace', data: [
{ dataIndx: 'Indx1', condition: 'equal', value: '1'},
{ dataIndx: 'Indx2', condition: 'equal', value: '2'},
{ dataIndx: 'Indx3', condition: 'equal', value: '3'}
]});
Like:
((Indx1 == '1' OR Indx2 == '1') AND Indx3 == '1') ?
-
Would the above be possible?
Thanks.
-
Such conditions are not supported.