ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on April 12, 2019, 02:12:39 pm

Title: AND condition in filter
Post by: queensgambit9 on April 12, 2019, 02:12:39 pm
Would it be possible to make use of search keywords in filter textbox?, ex contain condition:

term AND term
term OR term

Title: Re: AND condition in filter
Post by: paramvir on April 12, 2019, 07:00:45 pm
Yes you can call filter method.

https://paramquery.com/pro/api#method-filter

condition is passed as mode parameter.
Title: Re: AND condition in filter
Post by: queensgambit9 on April 15, 2019, 02:04:03 pm
Thanks, not sure I understand though. I want the user to be able to set conditions (AND, OR) by using those keywords directly in textbox.

Tried:
filter: { rule: { mode: 'AND' }, crules: [{ condition: 'contain' }]....

but not working...
Title: Re: AND condition in filter
Post by: paramvir on April 16, 2019, 02:09:04 pm
Please ensure the parameters are passed correctly as per the documentation API.

Substitute mode and values by user entered values.

Code: [Select]
grid.filter({
    rules: [
        {
            dataIndx: 'dataIndx of field',
            mode: 'OR',
            crules: [
                { condition: 'contain', value: a },
                { condition: 'contain', value: b }
            ]
        }
    ]
});
Title: Re: AND condition in filter
Post by: queensgambit9 on April 30, 2019, 02:38:14 pm
Thanks, still don't get it right though...would it be possible to see a working demo of this?