ExtJS Desktop Start Menu level Two menu, just a simple demonstration of the implementation principle, such as the need for dynamic generation, self-transformation can, the following basic method principle:
First create a JS file to generate Start menu data:
? function Getstartmenu (APP) {var menuarray = []; var m = {launcher: {text: ' Start menu First Level a ', Iconcls: ' Icon-grid ', handler:function () {return false; }, Menu: {minwidth:127, items: []}}; M.launcher.menu.items.push ({winId: ' Menua01 ', Winurl: ' abc/abcd.html ', Text: ' Start menu Second Level A01 ', MA Ximized: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 MenutwoGrade A01 ', width:600, height:500, Maximized:true, Maximizable:true, Resizable:true, iconcls: ' Icon-grid ', hide Mode: ' 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/bbbb.html ', Text: ' Start menutwoLevel 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 MenutwoGrade A02 ', width:800, height:600, Maximized:false, Maximizable:true, Resizable:false, iconcls: ' Icon-grid ', hi Demode: ' Offsets ', constrain:true, layout: ' Fit ', loader: { URL: ' abc/bbbb.html ', Autoload:true, scripts:true } }); } win.show (); Return win; } }); Menuarray.push (m); return Menuarray;}
In the main page introduce the file and then modify App.js, find Getmodules:function () {Delete inside the content changed to:
Getmodules:function () {
return Getstartmenu(this);
},
To implement the Start menu level two menu
ExtJS Desktop StartMenu (Start menu)