PDA

View Full Version : SearchField filter remains destroy.



aityahia
3 Mar 2009, 2:28 AM
hi all
for what have used SearchFiled (http://extjs.com/deploy/dev/examples/form/SearchField.js), I have remark that when the container of the component is destroyed the filter remains always applied to DataStore, which is which is problematic, to slove that I have to add this end of code.



Ext.app.SearchField = Ext.extend(Ext.form.TwinTriggerField, {
initComponent : function(){
Ext.app.SearchField.superclass.initComponent.call(this);
this.on('specialkey', function(f, e){
if(e.getKey() == e.ENTER){
this.onTrigger2Click();
}
}, this);

this.on('destroy',function (){this.onTrigger1Click();}); // added by aityahia
}
I hope that will help.