Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extjs unpress button

Tags:

button

extjs

I have an ExtJS button like this:

new Ext.SplitButton({
    text: 'Index',
    iconCls: 'index',
    scale: 'large',
    iconAlign: 'left',
    cls: 'header-item',
    handler: leftPanelNav, // handle a click on the button itself
    menu: new Ext.menu.Menu({
        items: [
            // these items will render as dropdown
            // menu items when the arrow is clicked:
            {text: 'Item 1'},
            {text: 'Item 2'}
        ]
    })
})

His state will be pressed at a time and I want to know how can I unpress it when I want to from script.

Thank you.

like image 425
Manny Calavera Avatar asked Sep 17 '09 00:09

Manny Calavera


People also ask

How do you center a button in Extjs?

var myWin = new Ext. Window({ height : 100, width : 200, maximizable : true, items : [ { xtype : 'button', text : 'myButton' // align : center } ] }); myWin. show();

In which config do we write the code for it to be executed when a button is clicked in Extjs?

Menus. You can assign a menu to a button by using the menu config. This config can be either a reference to a Ext.


1 Answers

Call toggle() on the button:

http://www.extjs.com/deploy/ext/docs/output/Ext.SplitButton.html (dead link)

http://dev.sencha.com/playpen/docs/output/Ext.SplitButton.html

If a state it passed, it becomes the pressed state otherwise the current state is toggled.

like image 161
Ates Goral Avatar answered Sep 28 '22 00:09

Ates Goral