I am trying to fire a click event on a button whose handler was given in the config object.
This is the code. My goal is to have the handler of the second button called in response of a click on the first button. But it does not work.
Code:
<div id='fire-btn'></div>
<div id='event-btn'></div>
Ext.onReady(function(){
fireBtn = new Ext.Button({
renderTo: 'fire-btn',
text: 'Fire click event',
handler: function(){
eventBtn.fireEvent('click');
}
});
eventBtn = new Ext.Button({
renderTo: 'event-btn',
text: 'Event Btn',
handler: function(){
alert('ok');
}
});
});
Thanks
Luca