ParamQuery grid support forum
General Category => Suggest new features => Topic started by: jplevene on September 20, 2024, 03:51:36 pm
-
Most other grids have it, when typing the filter in the header column, pqGrid only works with a timeout which then triggers the filter to start. Most other grids also have an option to also trigger the filter when the enter key pressed and also to disable the automatic timeout.
Please add an option for enabling [Enter] to trigger the filter and another option to disable the timeout filter.
ALSO, please could you allow the columnModel.filter to also be a function that returns the filter object, so instead of having to set the filter for multiple columns like this:
filter:{crules:[{condition:"contain"}], style:"text-align:left", listener:myListener, ....}
I could just do:
filter: myStandardFilter()
-
pqgrid already provides various inbuilt filter listener options and custom listeners.
-
The listeners work (I have made them work), and I have done them, but an option would be easier and would 100% work on new versions.
I also had to write the code below to prevent from doing 2 remote calls for the same filter, the second being triggered by the timeout:
var rule = { condition: ui.column.filter.crules[0].condition, dataIndx: ui.column.dataIndx, value: ui.value, value2: ui.value2 },
CM = this.grid.pqGrid("getColModel");
// Check if the filter is not already applied
for(var i=0, len = CM.length; i < len; i++){
// If there is no change
if( CM[i]["dataIndx"]===ui.column.dataIndx && ui.value===CM[i]["filter"]["crules"][0]["value"] && ui.value2===CM[i]["filter"]["crules"][0]["value2"] )
rule = null;
}
// If we have a rule, apply it
if(rule)
this.grid.pqGrid("filter", {
oper: "add",
rules: [
rule
]
});
The issue is that with new versions, the above might end up not being compatible.
Also you promised to add the "X" in the column input filter to clear the text. When you do this, my code might end up being incompatible.