PDA

View Full Version : Unresolved reference in TreeFilter



Rewand
12 Jul 2007, 6:17 AM
extjs 1.0.1a
windows xp
firefox 2.0.0.4

error:
this.clearFilter is not a function ext-all-debug.js line 18540

This error can come up when using a TreeFilter with either autoClear or clearBlank set to true.

A look at the code shows that TreeFilter has no clearFilter function but does have a function called clear. aliasing clear to clearFilter fixes things.



//added
clearFilter : function(){
this.clear();
},
clear : function(){
var t = this.tree;
var af = this.filtered;
for(var id in af){
if(typeof id != "function"){
var n = af[id];
if(n){
n.ui.show();
}
}
}
this.filtered = {};
}

mystix
12 Jul 2007, 6:35 AM
@rewand, thanks for reporting this.

jack / brian, this is also missing in 1.1 RC1.

mystix
12 Jul 2007, 6:44 AM
in the meantime, instead of messing directly with ext-all-debug.js / ext-all.js, just include this code block in your overrides file
Ext.override(Ext.tree.TreeFilter, {
clearFilter: this.clear
});and it should take care of the problem.

Rewand
12 Jul 2007, 7:04 AM
in the meantime, instead of messing directly with ext-all-debug.js / ext-all.js, just include this code block in your overrides file
Ext.override(Ext.tree.TreeFilter, {
clearFilter: this.clear
});and it should take care of the problem.

Good suggestion. I try to override/inherit as little as possible so as to avoid maint problems but in this case it's a decent best work around.

BTW I checked the 1.1 rc1 download and it has the same bug

Thanks

jack.slocum
12 Jul 2007, 7:35 PM
Thanks. Fixed.