ParamQuery grid support forum
General Category => Suggest new features => Topic started by: queensgambit9 on December 19, 2018, 03:19:26 pm
-
As I understand the built in filters is available based on the dataType set (if not specified in filter).
Currently I seem to get same list for 'string' and 'integer'...?
Also would it be possible to set filter condition back to the default by the user? (as set in crules).
'--None--' seems to do nothing.
-
1. FIlter options are still based on dataType, only that the support is widened ( compared to older versions <5.2 ) to support as much options as possible for a given dataType.
e.g. contain ( which normally applies to strings ) can find 000 from numbers 5600045,
"Mon" from dates "Monday 20, 2000"
"/20/" can find all dates with format "mm/dd/yy" whose day is 20,
begin: "05" can find all dates with format "mm/dd/yy" whose month is May, etc
2. Noted, would be taken care of in upcoming versions.
-
Thanks. Would it be possible to use 'equal' and 'notequal' as non range options (let user enter search criteria)?
Use case:
User wants to select all rows that do not have value '0'.
But I want to avoid loading all distinct values as options. Also it might be a lot of values to scroll to find the wanted one.
-
You mean you want textbox instead of dropdown for equal and not equal conditions.
It's answered here
https://paramquery.com/forum/index.php?topic=3008.msg11362#msg11362
-
Great, is it possible to affect specific column(s)?
-
Yes, please add this to column definition:
filterFn: function(ui){
if(ui.condition=='equal'){
return {
type:'textbox',
attr: "autocomplete='off'",
style: "cursor:auto;",
init: function(){
//return true to override internal initialization
return true;
}
}
}
}
-
If I use:
pq.filter.conditions.equal.filterFn = function(ui){
return {
type: 'textbox'
}
}
How can set specific columns to override and use built in dropdown behaviour?
-
it can't be overridden.
If you want some columns to have dropdown while others to have textbox for the same condition "equal", please assign this to the columns with textbox.
filterFn: function(ui){
if(ui.condition=='equal'){
return {
type:'textbox',
attr: "autocomplete='off'",
style: "cursor:auto;",
init: function(){
//return true to override internal initialization
return true;
}
}
}
}
-
Works fine, but there seems to be an issue when you try to set multiple conditions it still display range options (single select).
-
Not sure what you mean by multiple conditions ( in what context? ).
Could you please elaborate and share a jsfiddle.
-
Hope this makes it more clear.
https://next.plnkr.co/edit/g6wnbnRTCVajL2Lo?preview
-
Ok got it, per column solution to use textbox for equal condition is working in header filter row only, not in filter menu dropdown. I've marked this feature for further working on it.
Currently you might have to rely only on global replacement.
pq.filter.conditions.equal.filterFn = function(ui){
return {
type: 'textbox'
}
}