PDA

View Full Version : overrride TwinTriggerField function



ratamaster
30 Jun 2008, 7:21 AM
Hi
I have this :



new Ext.app.SearchField({
store: ds
,width: 120
})




As you know SearchField is an extendion of TwinTriggerField , TwinTriggerField has defined:



............
,onTrigger2Click : function(){
var v = this.getRawValue();
if(v.length < 1){
this.onTrigger1Click();
return;
}
var o = {start: 0,limit:30};
this.store.baseParams = this.store.baseParams || {};
this.store.baseParams[this.paramName] = v;
this.store.reload({params:o});
this.hasSearch = true;
this.triggers[0].show();
}




So if I want to override onTrigger2Click I could do this:



new Ext.app.SearchField({
store: ds
,width: 120
, onTrigger2Click: function (){
//whatever
}
})



In the case I would like to only redefine/override: var o = {start: 0,limit:30}; from onTrigger2Click, how could I do it? Is this possible?

evant
30 Jun 2008, 2:32 PM
Not possible, you'd need to override the whole method body.

ratamaster
30 Jun 2008, 3:23 PM
ok, thank you!