I am trying to add two functions inside the same listener to be able to combine two values of a combo with two fields disabled and to be enabled depending on the value that it chooses. This is the listener that I created:
listeners: {
render: function() {
var pago = this;
pago.onChangeCuentasFn();
pago.onChangeFormaPagoFn();
}
}
And these are the functions that the Listener calls:
onChangeFormaPagoFn: function(combo, record, index) {
var iban = Ext.getCmp('clieIban');
iban.clearInvalid();
if (record.data.codigo == 4) {
iban.setDisabled(false);
} else {
iban.setDisabled(true);
}
},
onChangeCuentasFn: function(combo, record, index) {
var cuenta = Ext.getCmp('clieCuentas');
cuenta.clearInvalid();
if (record.data.codigo == 3) {
cuenta.setDisabled(false);
} else {
cuenta.setDisabled(true);
}
},
Do I have to add addListener or play with functions inside the listeners?
Thank you!