Reputation: 2480
I define a 'panel' extend: 'Ext.form.Panel' that has a tbar with three buttons.
when my other work done i want my 3nd button on tbar must click to do some task.
I don't want create a new function with same task like panel.myfunction().
Any way to do that thanks
Upvotes: 1
Views: 1644
Reputation: 15673
var button = this.down('button[action=save]');
button.fireEvent('click', button);
Upvotes: 1
Reputation: 5712
I think this may be close to what you want:
panel.down("toolbar").items.items[3].handler();
If you really want the third visible button, I think instead of 3 you should be using 2 for the array index:
panel.down("toolbar").items.items[2].handler();
Upvotes: 2