I’m having trouble with disabling button with custom template and a click listener. Here’s the button code:
items: [
{
autoEl: {
tag: 'div'
},
cls: 'btn-save uiBtn blue',
html: '<label><input type="button" value="SAVE"></label>',
xtype: 'button',
listeners:{
'click': {
element: 'el',
fn: function(){
this.submitForm();
}
},
scope:this
}
},
Unfortunately inside the click event handler function no. disable(), dom.disabled = 'true' doesn’t work. How to disable this kind of button ?
You’ve changed scope of the listener, so this points to something else than button. You should use handler argument: