tags:

views:

720

answers:

2

Hello. 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.

A: 

Question is vague, and I'm no ExtJS animal.

That said:

What happens is you get a handle of the button and fire the mouseup event?

timdev
+2  A: 

Call toggle() on the button:

http://www.extjs.com/deploy/ext/docs/output/Ext.SplitButton.html

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

Ates Goral
Thank you for your answer.
Manny Calavera