ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on February 07, 2016, 09:02:09 pm
-
Hi
I use in ColModel
...
dataType: "integer", filter: { type: 'textbox', condition: 'begin',
...
when I use condition: 'contains' I get error: "Uncaught TypeError: f is not a function"
How can I use datatype integer and filter with contains condition?
thanks
-
contain condition works with dataType: string
Callback could be used for numbers:
condition: function(a, b){
if ( ( a + "" ).indexOf( ( b + "" ) ) >= 0 ){
return true;
}
},
-
tried:
{title:"columnd", width:90, dataIndx: "columnd", dataType: "integer", filter: { type: 'textbox', condition: function(a, b){
if ( ( a + "" ).indexOf( ( b + "" ) ) >= 0 ){
return true;
}, listeners: ['keyup']}
}},
doesn't work...where to place the callback to function properly?
thanks
-
Please recheck:
condition: function(a, b){
b = isNaN(b)? "": b+"";
a = a+"";
if ( !b.length || a.indexOf( b ) >= 0 ){
return true;
}
},
http://jsfiddle.net/b6b710mz/116/
Note that leading zeros are ignored with this method e.g., if 051 is entered in textbox, it would search for 51 in the cells.