ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: rsgmedia on March 21, 2017, 09:09:49 pm
-
Hi PQ Support team,
We have a requirement where we need to filter the data based on two columns/values. We tried to use the existing options from columnModel.filter but not much luck. Here is the scenario...
1. Grid has StartDate & EndDate columns, filtering is enabled on both columns, it shows a date picker.
2. User chooses a date in the StartDate Filter. Let's say the selected date is March 1st, 2017 (03/01/2017).
3. We need to filter the grid rows whose dates are overlapping with 03/01/2017. i.e. rows for which 03/01/2017 is between their StartDate & EndDate.
An example code snippet would be really helpful.
Thanks in advance.
-
In the filter listener function
listeners: [{ 'change': function (evt, ui) {
var val = ui.value; //e.g., '03/01/2017', user chosen date.
grid.filter({
data: [
{dataIndx: 'startDate', condition: 'lte', value: val },
{ dataIndx: 'endDate', condition: 'gte', value: val }
]
})
}}]