extjs desktop startmenu (開始菜單),extjsstartmenu

來源:互聯網
上載者:User

extjs desktop startmenu (開始菜單),extjsstartmenu

extjs desktop 的開始菜單 二級菜單,只是簡單示範實現原理,如 需要動態產生,自己改造即可,以下基本方法原理:


首先 建立一個js檔案 產生開始菜單資料:


function GetStartMenu(app) {    var menuArray = [];    var m = {        launcher: {            text: '開始菜單第一級A',            iconCls: 'icon-grid',            handler: function() {                return false;            },            menu: {                minWidth: 127,                items: []            }        }    };    m.launcher.menu.items.push({        winId: 'menua01',        winUrl: 'abc/abcd.html',        text: '開始菜單第二級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: '開始菜單第二級A01',                    width: 600,                    height: 500,                    maximized: true,                    maximizable: true,                    resizable: true,                    iconCls: 'icon-grid',                    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/bbbb.html',        text: '開始菜單第二級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: '開始菜單第二級A02',                    width: 800,                    height: 600,                    maximized: false,                    maximizable: true,                    resizable: false,                    iconCls: 'icon-grid',                    hideMode: 'offsets',                    constrain: true,                    layout: 'fit',                    loader: {                        url: 'abc/bbbb.html',                        autoLoad: true,                        scripts: true                    }                });            }            win.show();            return win;        }    });    menuArray.push(m);    return menuArray;}

在首頁面引入該檔案 然後修改app.js,找到 getModules: function () {  刪除裡面內容 改為:

   getModules: function () {
           return GetStartMenu(this);
    },

即可實現開始菜單的二級菜單



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.