ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on April 04, 2019, 07:30:23 pm
-
I have celldata like: value1, value2 etc for a specific column...I would the options (range) in the filter to be populated as available celldata split by comma (,)...so option list becomes:
value1
value2 etc
Then use a custom built filter for range where it compares with contain condition.
I use remote data and filtermodel.
How do I assign the options in best way?
-
Do you also use remote paging?
-
Yes.
-
Options can't be created locally for remote paging because data in grid is for current page only.
You need to create the options remotely and assign them to column.filter.options in an ajax call.
-
After I get the response from ajax call I assign them as:
grid.getColumn({ dataIndx: key }).filter.options = response[ key ];
But I need to manipulate the values before assigning them (each , separated value as own option).
Ex of array element:
{col1: "value1, value2, value3"}
...I need the as single array elements {col1: "value1} etc
How would I best do this?
-
This is a data structure related question. ( not directly related to grid )
First you have to get all the values ( from all objects in array ) in a single array and then get unique values.
https://stackoverflow.com/questions/38206915/filter-out-array-to-have-only-unique-values/38206980
and reconvert it into
[{col1: val1}, {col1: val2}, ...]
format.