Hi I create a simple menu with ExtJS 5.1.0 using Sencha Cmd 5.1.0.26.
When I load the app the first time every works fine. First menu is show, if I chick con the second "+", second menu is shown, then if I click on the third menu "+" is shown.
Ext.menu inside a Panel with accordion layout
The component is very simple.
There is a panel component with a accordion layout.
Each item has a menu component with x items.
Here my code:
Code:
Ext.define("MyApp.view.mainMenu.MainMenu",{
extend: "Ext.panel.Panel",
requires: [
'MyApp.view.mainMenu.MainMenuController',
'MyApp.view.mainMenu.MainMenuModel',
],
xtype:'mainMenu',
controller: "mainmenu-mainmenu",
viewModel: {
type: "mainmenu-mainmenu"
},
region:'west',
title:'Main Menu',
collapsible: true,
width:250,
items:[
{
xtype:'panel',
layout: {
type: 'accordion',
titleCollapse: false,
animate: true,
activeOnTop: false
},
items: [
{
title:'Menu 1',
items:[
{
xtype:'menu',
floating: false,
items: [
{ text: 'regular item 11' },
{ text: 'regular item 12' },
{ text: 'regular item 13' },
{ text: 'regular item 14' }
]
}
]
},
{
title:'Menu 2',
items:[
{
xtype:'menu',
floating: false,
items: [
{ text: 'regular item 21' },
{ text: 'regular item 22' },
{ text: 'regular item 23' },
{ text: 'regular item 24' }
]
}
]
},
{
title:'Menu 3',
items:[
{
xtype:'menu',
floating: false,
items: [
{ text: 'regular item 31' },
{ text: 'regular item 32' },
{ text: 'regular item 33' },
{ text: 'regular item 34' }
]
}
]
}
]
}
]
});
When I load the app the first time every works fine. First menu is show, if I chick con the second "+", second menu is shown, then if I click on the third menu "+" is shown.
If I came back to reopen the first menu item by clicking on the first "+" the menu content is blank. The menu component is no visible anymore.
I attach a screenshot to explain better what I see.
Any ideas?
Thanks for the tips.
Best regards
Ext.menu inside a Panel with accordion layout
Aucun commentaire:
Enregistrer un commentaire