PDA

View Full Version : Click on button using code



luca.santaniello
14 Mar 2011, 6:36 AM
Hi all,

I have toolbar with many buttons. The buttons are groupButton, only one is active. I need click on button using code. How can I do it?

I have get Button...



var myBtn = Ext.getCmp('myBtn');

//and then???
myBtn.???


Thanks in advance

dj
14 Mar 2011, 6:55 AM
It's Ext.Button#toggle: http://dev.sencha.com/deploy/dev/docs/?class=Ext.Button&member=toggle

luca.santaniello
14 Mar 2011, 7:02 AM
It's Ext.Button#toggle: http://dev.sencha.com/deploy/dev/docs/?class=Ext.Button&member=toggle

Thanks very much

wemerson.januario
14 Mar 2011, 8:12 PM
try this


youButton.fireEvent('click');

luca.santaniello
14 Mar 2011, 11:38 PM
toggle method is perfect for me, thanks