DeLe
DeLe

Reputation: 2480

Extjs Panel - Set click a button on tbar

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

Answers (2)

dbrin
dbrin

Reputation: 15673

var button = this.down('button[action=save]');
button.fireEvent('click', button);

Upvotes: 1

Reimius
Reimius

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

Related Questions