ParamQuery grid support forum
General Category => Help for ParamQuery Grid (free version) => Topic started by: TonyLeech on August 25, 2020, 03:10:25 am
-
I've been using the standard header filter for a long time with a listener to convert from a datepicker to a millisecond timestamp.
{ title: "Oldest Count", minWidth: 175, dataIndx: "oldestcount", align:"center", editable: false, dataType:"integer",
render: formatDate,
filter: { crules: [{condition: "between"}],
init: uiDatePicker,
listeners: [{ 'change': function(evt, ui) {
ui.value = millisecondsFromShortDate(ui.value);
ui.value2 = millisecondsFromShortDate(ui.value2);
$(evt.target).closest(".pq-grid").pqGrid('filter', {
oper: "add",
rules: [ui]
})
}}]
}
}
When I use the datepicker in the MenuUI filter the colModel filter listener does not trigger. Is there a listener for the MenuUI filter? Alternatively, can you advise how I can intercept the MenuUI filter to convert the datepicker into a millisecond timestamp before the remote request is triggered by the filter?
Thanks in advance.
-
https://paramquery.com/pro/api#option-column-filter
It's a singular listener:
listener: function(evt, ui){
this.filter({
oper: "add",
rules: .....
});
}
-
I changed it to single listener, but it doesn't trigger from the menuUI icon.
{ title: "Oldest Count", minWidth: 175, dataIndx: "oldestcount", align:"center", editable: false, dataType:"integer",
render: formatDate,
filter: { crules: [{condition: "between"}],
init: uiDatePicker,
listener: function(evt, ui) {
ui.value = millisecondsFromShortDate(ui.value);
ui.value2 = millisecondsFromShortDate(ui.value2);
this.filter({
oper: "add",
rules: [ui]
})
}
}
}
The original header filter box with datepicker works fine and triggers the listener, but using the filter build into the menuUI icon selects a date, but doesn't trigger the listener and so sends a raw date string rather than the millisecond timestamp that I should get from the listener. I've included all the code for the column in colModel...should I be putting the filter listener somewhere else like inside filterModel?