ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: arborresearch on March 24, 2017, 01:19:12 am

Title: Filter for multiple conditions within the same dataIndex
Post by: arborresearch on March 24, 2017, 01:19:12 am
I would like to know if it is possible to filter one column/dataIndex by multiple values at the same time. An example would be to filter for all last names that are either 'smith' or 'jones'. I have tried the code below without success

filterModel: { on: true, mode: "OR", header: true }
---------
$grid.pqGrid("filter", { oper: 'replace', data: [{ dataIndx: 'LastName', condition: 'contain', value: 'smith' }, { dataIndx: 'LastName', condition: 'contain', value: 'jones' }] })


Thank you!
Title: Re: Filter for multiple conditions within the same dataIndex
Post by: paramvir on March 24, 2017, 10:46:59 am
Only one condition can be applied to a single dataIndx.

condition: 'range' or 'regexp' can be used for multiple matches within single column.

As an example https://paramquery.com/pro/demos/filter_header_local range condition can be used for Shipping region column.

https://paramquery.com/pro/api#method-filter
Title: Re: Filter for multiple conditions within the same dataIndex
Post by: arborresearch on March 24, 2017, 08:21:31 pm
Thank you for this information! The 'regexp' condition along with a pipe delimited value resolved my issue.

$grid.pqGrid("filter", { oper: 'replace', data: [{ dataIndx: 'LastName', condition: 'regexp', value: 'jones|smith' }