PDA

View Full Version : Toggle button Pressed



Soumyajm
23 Jul 2012, 12:14 AM
Hi,
On some event i need to make the toggle button as pressed. It should happen dynamically .For that i am doing like this
Ext.getCmp(id).pressed=true;
Ext.getCmp(id).toggle=true;

But its not working . Please help me out in this one.

evant
23 Jul 2012, 12:22 AM
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.button.Button-method-toggle

Soumyajm
23 Jul 2012, 12:30 AM
Iam using toggle=true, but its not working. Can u please tell how to set button property as pressed dynamically.

evant
23 Jul 2012, 12:33 AM
Please read the documentation I linked. It's a method.

Farish
23 Jul 2012, 1:38 AM
Ext.getCmp(id).toggle(); // to toggle current state

Ext.getCmp(id).toggle(true); // to force pressed state

Ext.getCmp(id).toggle(false); // to force unpressed state

Soumyajm
23 Jul 2012, 2:48 AM
Toggle(pressed) not working . For toggle method we need to pass boolean value . Its working now .
toggle(1,1) . Now its working for me .

kamal2104
13 May 2013, 11:01 PM
how to get the value for the button(xtype: 'button'). I need to save the button value to DB, because when the page load next time the particular button should be pressed. that means the value should happen dynamically.
Can any one help me in this case ??