Reputation: 4031
I dynamically create several panels and add the into an accordion menu. For each of this panels I want to add an ext.menu.Menu
component but when I try do that the menu is not visible and also not present in the DOM. I also create a few menu items which I add to the menu.
for (var i = 0; i < store.totalCount; ++i){
var rec = store.getAt(i);
var panelItem = new Ext.panel.Panel({
title: (Ext.Date.format(rec.data.dateBorn, 'd-m-Y')) + " " + rec.data.name,
value:rec.data.VALUE_FIELD,
});
panel.add(panelItem);
var userMenu = new Ext.menu.Menu({
width: 120,
height: 70,
className:"menu"
});
panelItem.add(userMenu);
}
If I create a menu item and add to the panel it is shown, but I want to have them in a menu, What is wrong here?
Upvotes: 2
Views: 1455
Reputation: 4016
Menu is by default floating component. To configure component as floating or not floating you can use floating
configuration property.
So if you want to display menu directly in your panel the configuration of menu should be:
var userMenu = new Ext.menu.Menu({
width: 120,
height: 70,
className:"menu",
floating: false,
});
Upvotes: 2