Recently in the use of ExtJS to do the system, ready to ExtJS desktop on the basis of the transformation, because the official example only a level menu, for the two-level menu calls there is no way, so want to click on the desktop shortcut icon can also open the window of the words need to find another way.
After viewing the source code, found that it is not very difficult, want to achieve the goal only need to modify the ExtJS desktop with examples of two JS file can, paste code, welcome correction:
App.js
Getmodule:function (name) {var ms = This.modules; for (var i = 0, len = ms.length; i < Len; i++) {if (Ms[i].id = name | | Ms[i].apptype = = name) {return ms[i];} else {if (ext.isdefined (ms[i].launcher.menu) = = True && ms[i].launcher.men U.items.length > 0) {for (var j = 0, lens = ms[i].launcher.menu.items.length J < lens; J +) {if (ms[i].launcher.me Nu.items[j].id = = name) {return ms[i].launcher.menu.items[j];}} }} return '; }
Desktop.js
if (shortcuts) {shortcuts.on (' click ', function (E, t) {if (t = e.gettarget (' dt ', shortcuts)) {e.stopevent (); var module = App . GetModule (T.id.replace ('-shortcut ', ')); if (module) {if (ext.isdefined (module.itemid) = False) {Module.createwindow ();} else {var str = t.id.replace ('-shortcut ') , ''); var strleft = str.substring (0,str.indexof ("-")); var strright = str.substring (Str.indexof ("-") +1); var strlefts = strleft.substring (0,1). toUpperCase () +strleft.substring (1); var strrights = strright.substring (0,1). toUpperCase () +strright.substring (1); var fun = "Create". Concat (Strlefts). Concat (strrights). Concat ("window ()"); Eval ("Module.scope.") + fun); } } } }); }
[For example, the menu ID is menu-query, then the method to create the window is Createmenuquerywindow, so that's OK]
Additionally, in the JS file on the page side, you need to configure the ItemId property