Sto usando Extjs 4.1.Extjs 4.1 Come posso chiamare il metodo controller da un campo modulo
Come posso chiamare un metodo controller da un modulo che già utilizza questo metodo tramite un'azione di clic del pulsante? Voglio che questo metodo sia riutilizzabile da un campo modulo, ma non so come farlo.
// Ecco il mio codice di controllo
init: function() {
this.control({
'salewindow button[action=resetAll]': {
click: this.resertform
}
});
},
resertform : function(button){
var store = Ext.data.StoreManager.get('Items');
store.destroy();
var vatstore = Ext.data.StoreManager.get('Vats');
vatstore.reload();
}
// e qui è il mio campo da ascoltatore
{
xtype : 'textfield',
name : 'BranchId',
fieldLabel : 'Branch Id',
allowNegative : false,
id : 'branchid',
value : '1',
onBlur : function(){
restoreItem();// I want to call above controller method from here
}
}
Grazie VDP per correzione –