Learn extjs5 with me (13 -- execute the menu command to display the module in tabPanel), extjs5tabpanel

Source: Internet
Author: User

Learn extjs5 with me (13 -- execute the menu command to display the module in tabPanel), extjs5tabpanel
Learn extjs5 with me (13 -- execute the menu command to display the module in tabPanel) and design the main interface of a module. The following describes how to add this module to the main interface by executing the menu command. There is a function in MainModule. js that generates the current menu data:

// According to data. systemMenu generate menu bar and the menu data used under the menu button getMenus: function () {var items = []; var menuData = this. get ('systemmenu '); // obtain the defined menu data Ext. array. each (menuData, function (group) {// traverses the array var submenu = [] of the menu item; // traverses the array Ext of the menu bar for each menu item. array. each (group. items, function (menuitem) {submenu. push ({mainmenu: 'true', moduleName: menuitem. module, text: menuitem. text, icon: menuitem. icon, glyph: menuitem. glyph, handler: 'onmainmenuclick' // event handler in MainController}) var item = {text: group. text, menu: submenu, icon: group. icon, glyph: group. glyph}; items. push (item) ;}) return items ;}
Handler: 'onmainmenuclick' is to execute the onMainMenuClick function in MainController. js after clicking the menu. Modify the MainController. js file and introduce Module. js first.
uses : ['app.view.module.Module'],

Then modify the function:
// Select the menu on the main menu and run onMainMenuClick: function (menuitem) {var maincenter = this. getView (). down ('maincenter'); maincenter. setActiveTab (maincenter. add ({xtype: 'lelepanel ', closable: true, reorderable: true }));}

In this way, each time you click a menu, a Module is generated and put into the tabPanel.
Next let's take a look at another function in tabPanel. Right-click the tab and a pop-up menu will appear.

Some functions can be used and can be disabled, indicating that the current tab can be turned off. There is an X in the top of the name. If it can be disabled, X will disappear, in addition, the functions that are automatically enabled and enabled at login are not ready yet.

In the EXTJS tree menu, click "TabPanel in the middle" to switch to the page. The error 80020101 is displayed. It is said that the page to be connected has the EXT core file.

Maybe you have written a comma there and checked it with the spket tool.

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.