Extjs desktop startmenu (Start menu)

Source: Internet
Author: User
Tags autoload

Extjs desktop startmenu (Start menu)

The level-2 menu of the Start Menu of extjs desktop is just a simple demonstration of the implementation principle. If you need to dynamically generate the menu, you can modify it yourself. The basic principles are as follows:


First, create a js file to generate the Start Menu data:


? Function GetStartMenu (app) {var menuArray = []; var m = {launcher: {text: 'start menu level 1 A', iconCls: 'icon-grie', handler: function () {return false ;}, menu: {minWidth: 127, items: [] }}; m. launcher. menu. items. push ({winId: 'menua01', winUrl: 'abc/abcd.html ', text: 'start menu level 2 a01', maximized: false, iconCls: 'icon-grid ', scope: this, handler: function (src) {var desktop = app. getDesktop (); var win = Desktop. getWindow ('menua01'); if (! Win) {win = desktop. createWindow ({border: false, id: 'menua01', title: 'start menu level 2 a01', width: 600, height: 500, maximized: true, maximizable: true, resizable: true, iconCls: 'icon-grie', hideMode: 'offsets', constrain: true, layout: 'fit ', loader: {url: 'abc/abcd.html ', autoLoad: true, scripts: true});} win. show (); return win ;}}); m. launcher. menu. items. push ({winId: 'menua02', winUrl: 'abc/B Bbb.html ', text: 'start menu level 2 a02', maximized: false, iconCls: 'icon-grid', scope: this, handler: function (src) {var desktop = app. getDesktop (); var win = desktop. getWindow ('menua02'); if (! Win) {win = desktop. createWindow ({border: false, id: 'menua02', title: 'start menu level 2 a02', width: 800, height: 600, maximized: false, maximizable: true, resizable: false, iconCls: 'icon-grie', hideMode: 'offsets', constrain: true, layout: 'fit ', loader: {url: 'abc/bbbb.html ', autoLoad: true, scripts: true});} win. show (); return win ;}}); menuArray. push (m); return menuArray ;}

Introduce the file on the home page, modify app. js, find getModules: function () {and change the content:

GetModules: function (){
Return GetStartMenu (this );
},

You can implement the level-2 menu of the Start Menu.



Related Article

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.