0

I'm showing an ext js menu from a button, the default behaviour is that the menu is hidden when you click outside of it. How can I make it fixed until I click the button again?

xtype: 'button',
    text: 'MyButton',
    menu: {
        xtype: 'menu',
        showSeparator: false,
        items: [
            {
                xtype: 'colorPickerWidget',
                listeners: {
                    colorchange: {
                        fn: me.onColorPickerWidgetColorChange,
                        scope: me
                    }
                }
            }
        ]
    }
}
Jacob
  • 3,580
  • 22
  • 82
  • 146

1 Answers1

0

You could use a different approach:

In the onClick event handler of your button create a new window (Ext.Window) that includes your colorPickerWidget. Also check if your window already exists. In this case, hide it.

Upon creating the window make sure that property modal: false (the default value) and set the position of the window (x & y properties). You can get the 2 values from your button (Check this)

Community
  • 1
  • 1
alex.butnar
  • 284
  • 3
  • 10