ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on October 07, 2016, 02:58:19 pm

Title: Set filter value after initialization
Post by: queensgambit9 on October 07, 2016, 02:58:19 pm
I would like to apply a value to a filter after initialization. Not the complete filter option, just applying a value.
What would be the best approch?

Tried:

Code: [Select]
colM[1].filter = {value: "test"}
But can't get it to work.

Thanks.
Title: Re: Set filter value after initialization
Post by: paramvir on October 07, 2016, 03:54:30 pm
Please use filter method.

http://paramquery.com/pro/api#method-filter
Title: Re: Set filter value after initialization
Post by: queensgambit9 on October 07, 2016, 06:43:52 pm
Thanks, when I try running:

Code: [Select]
$( ".selector" ).pqGrid( "filter", {
    oper: 'replace',
    data: [{ dataIndx: 'column1', condition: 'great', value: 0 }
    ]
});

I get no error, but no value is inserted?
Title: Re: Set filter value after initialization
Post by: paramvir on October 10, 2016, 09:53:13 am
Please substitute ".selector" with actual selector of grid in your case, verify the dataIndx value and the column should be numeric ( float or integer ) for condition: 'great'.

Please share jsfiddle if still facing the issue.
Title: Re: Set filter value after initialization
Post by: queensgambit9 on October 10, 2016, 02:07:47 pm
http://jsfiddle.net/v7gscjfy/1/

Trying to set query param in url and then set filter depending on value.
I'm sure there is a better way of doing this so please feel free to advise  :).

Thanks.
Title: Re: Set filter value after initialization
Post by: paramvir on October 11, 2016, 02:58:30 pm
As mentioned in my previous post, please substitute ".selector" with actual selector of grid in your case.

And use refreshHeader to show the value in header filter row, when filter method is used.

http://jsfiddle.net/v7gscjfy/3/