Learn Extjs5 with Me (13--execute menu command to display modules in TabPanel)

Source: Internet
Author: User

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.         

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.