PDA

View Full Version : Button setPressed() function ?



iNes14
11 Jun 2012, 11:21 PM
Hello,

Does anybody know how to set a Button pressed after the rendering of the Button, without having to actually click on the Button ?

There's a public property pressed but it's read-only

Thank you

evant
11 Jun 2012, 11:24 PM
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.button.Button-method-toggle

Raavi
13 Jun 2012, 11:18 PM
Ext.getCmp('button').setPressedButtons(['button]);

sword-it
14 Jun 2012, 2:38 AM
Hi iNes14,
Try this code, It will work for you.



Ext.create('Ext.Container', {
renderTo: Ext.getBody(),
items : [
{
xtype: 'button',
text : 'My Button'
, listeners: {
afterrender: function () {
this.toggle(true);
}
}
}
]
});