Learn Extjs5 with Me (13--execute menu command to display modules in TabPanel)The main interface of a module is designed, and the module is added to the main interface through the execution of the menu command. In Mainmodule.js, there is a function that generates the current menu data:
Based on the Data.systemmenu generated menu bar and Menu buttons below the menu data used Getmenus:function () {var items = [];var Menudata = This.get (' Systemmenu ');//Get fixed Good menu Data Ext.Array.each (menudata, function (group) {//iterates through the array of menu items var submenu = [];//for each menu item, traversing the array Ext.Array.each of the bar ( Group.items, Function (MenuItem) {Submenu.push ({mainmenu: ' true ', Modulename:menuitem.module,text:menuitem.text, Icon:menuitem.icon,glyph:menuitem.glyph,handler: ' Onmainmenuclick '///Maincontroller event handler})}) var item = {TEXT:GR Oup.text,menu:submenu,icon:group.icon,glyph:group.glyph};items.push (item);}) return items;}
One of the handler: ' Onmainmenuclick ', is to execute the Onmainmenuclick function in maincontroller.js after clicking on the menu. Modify the Maincontroller.js file, first introduce module.js
Uses: [' App.view.module.Module '],
Then modify the function inside:
After you select the menu on the main menu, execute Onmainmenuclick:function (MenuItem) {var maincenter = This.getview (). Down (' Maincenter '); Maincenter.setactivetab (Maincenter.add ({xtype: ' Modulepanel ', closable:true,reorderable:true}));}
This will generate a module for every click of the menu and put him in the TabPanel.
then look at another feature in TabPanel, right-click on the tab and there will be a popup menu.
There are some features that can be used, can be closed, indicating that the current tab can be turned off, there is an x above the name, if the cancellation can be closed, the X will disappear, and the login automatically open and the most open function is not yet done.