Demo:Menu Bar_SAP刘梦_新浪博客

效果图

 

代码

        </<span style="color:#3f7f7f">script>

        

 

        <<span style="color:#3f7f7f">script>

        //Function to handle the select event of the items

        var handleSelect = function(oEvent){

            alert(oEvent.getParameter("item").getId());

        };

        // Create a menu bar instance

        var oMenuBar = new sap.ui.commons.MenuBar("menuBar");

 

        // Create two main menu items for the menubar - for which you define subitems lateron

        var oMbProjct = new sap.ui.commons.MenuItem("menuBar_Project",{text:"Project"});

        oMenuBar.addItem(oMbProjct);

        var oMbRole = new sap.ui.commons.MenuItem("menuBar_Roles",{text:"Roles"});

        oMenuBar.addItem(oMbRole);

        

        oMbRole.attachSelect(handleSelect);

 

        // Create a menu instance for the "Project" menu

        var oMsubProj = new sap.ui.commons.Menu("menu1");

        oMbProjct.setSubmenu(oMsubProj);

 

        // Create and add five sub-items for the "Project" menu

        var oMiShow = new sap.ui.commons.MenuItem("item1_Show",{text:"Show"});

        oMsubProj.addItem(oMiShow);

        var oMiPropty = new sap.ui.commons.MenuItem("item_Property",{text:"Properties"});

        oMsubProj.addItem(oMiPropty);

        oMiPropty.attachSelect(handleSelect);

 

        //Create a sub menu for item "Show"

        var oMsubShow = new sap.ui.commons.Menu("menu2");

        oMiShow.setSubmenu(oMsubShow);

        var oMiTask = new sap.ui.commons.MenuItem("item_Task",{text:"Tasks"});

        oMsubShow.addItem(oMiTask);

        oMiTask.attachSelect(handleSelect);

        var oMiResp = new sap.ui.commons.MenuItem("item_Pesp",{text:"Responsibilities"});

        oMsubShow.addItem(oMiResp);

        oMiResp.attachSelect(handleSelect);

 

 

        // Attach the menubar to the page

        oMenuBar.placeAt("content");

 

        </<span style="color:#3f7f7f">script>

友情推广:

第一课堂HANA系统搭建完成,公网双IP访问,速度有保证,

进第一课堂群139446252,免费领取HANA测试账号。

申请时验证信息可输入来自本博客

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值