PDA

View Full Version : Dropdown button in menu trouble



avm74
19 Mar 2013, 3:03 AM
Hello.
I have panel with some elements (second dropdown button) in dropdown button menu.
When I click second dropdown button, main menu is closing. any ideas?

Here is my code:



Ext.onReady(function () {
Ext.create('Ext.Button', {
text: 'Click me',
margin: 10,
renderTo: Ext.getBody(),
menu: getMenu()
});
});

function getMenu() {
return Ext.create('Ext.menu.Menu', {
plain: true,
items: [
Ext.create('Ext.panel.Panel', {
width: 500,
height: 100,
bodyPadding: 5,
items: [
getFirstElement(),
getSecondElement()
]
})
]
});
}

function getFirstElement() {
return Ext.create('Ext.form.field.Date', {
fieldLabel: 'Date',
value: null,
labelWidth: 50,
width: 150,
padding: 5
});
}

function getSecondElement() {
return Ext.create('Ext.Button', {
text: 'Select',
menu: Ext.create('Ext.menu.Menu', {
plain: true,
items: [
Ext.create('Ext.panel.Panel', {
width: 500,
height: 100,
bodyPadding: 5,
items: [
{
html: '1'
},
{
html: '2'
}
]
})
]
})
});
}

4250242503

mitchellsimoens
21 Mar 2013, 6:29 AM
Just tried your code with 4.1.3 and Chrome 26 and worked fine for me.