ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: niketnaik on June 23, 2022, 11:19:09 am
-
Hello, I want to filter the data from single header but criteria should be from multiple columns. What i want to achieve is (see sample attaced) I want to have filter on first name field, so when ever user will search by providing the value ( George ) then it will display single result but if user search for (Alcock) then it will display 3 results (1 from first name, 2 from last name). How can i achieve that ??
-
Please use this filter definition ( with required changes ) for firstname column.
filter: { crules: [{condition: 'contain' }], listener: function(evt, ui){
debugger;
var filterRules = [{ dataIndx: 'firstname', condition: 'contain', value: ui.value},
{ dataIndx: 'lastname', condition: 'contain', value: ui.value}];
this.filter({
oper: 'replace',
rules: filterRules
});
}}
-
Thank you for replying. I tried with the solution you provided but it doesn't seem to be working for me. If i apply only one filterRules at single time then it is working perfectly but not with both. Can you please share complete jsfiddle so that i can figureout what i am doing wrong to achieve the desired out put?
-
Please add mode: 'OR' to filter method.
this.filter({
oper: 'replace',
mode: 'OR",
rules: filterRules
})
Reference: https://paramquery.com/pro/api#method-filter
-
Excellent. Working perfectly. Thank you. :)