Showing posts with label Ext JS Button. Show all posts
Showing posts with label Ext JS Button. Show all posts

Tuesday, 30 April 2013

How to check button pressed in ExtJs3.4 and make it pressed programmatically

To fetch the button status

var btnPressed = Ext.getCmp("#elementId").pressed;

The btnPressed contains boolean value

To make it pressed programmatically you can use toggle function

Ext.getCmp("#elementId").toggle();

This function changes the pressed state of the button

Suppose we want that if its pressed we want to un-press  it

if(btnPressed)
{
        Ext.getCmp("#elementId").toggle();
}


Ref 1
Ref 2