ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: WTC_User on September 28, 2017, 06:37:28 pm
-
Hi all,
I need to create a simple textarea header filter (remote filter) but I want that the filter will be applied only if the search query has a min length (like 3).
I immagin that i've to create a custom listener...that's correct?
In the api documentation I found that:
"listeners is an array used to bind control with the events upon firing of which a callback function is called.
Format is listeners: [ { 'name of event' : function( evt, ui ){ } } ,... ] where ui in the callback is an object holding the following properties."
so I've create this:
filter: {
type: 'textbox',
condition: 'contain',
listeners: [{
'myEvent': function (evt, ui) {
//?? return ui.value.length>2; ??
}
}]
}
But nothing to do! What I've to write to fire the filter?
-
Custom listener is created this way. The keyname of listener should be a valid DOM event name like change, input, keyup, downdown, etc.
filter: {
type: 'textbox',
listeners:[{"keyup": function(evt, ui) {
var len = ui.value.length;
if(len > 2 || len==0){
grid.filter({
data: [{dataIndx: ui.dataIndx, value: ui.value, condition: 'contain'}]
});
}
}}]
}
http://jsfiddle.net/djdfk7yd/
-
Thank you so much man! 8)