簡體   English   中英

如何在 sap ui5 中動態創建的菜單中綁定 omodel 數據?

[英]how to bind omodel data in dynamically created Menu in sap ui5?

我想在菜單項中綁定描述,如下圖所示:

            var menu=new sap.m.Menu({
                path : "/plants",
                title: "Notes For1234: ",
                template: new sap.m.MenuItem({                                        
                       text: "{description}",
                       })


            });
            that.getView().addDependent(menu);

            menu.setModel(thisOfBtn.getModel());
            const eDock = sap.ui.core.Popup.Dock;
            menu.openBy(oButton,false, eDock.BeginTop, eDock.BeginBottom, false);
        }

[代碼圖像] 1

菜單圖片在此處輸入圖像描述

我想在菜單項中綁定描述,如下圖所示:

            var menu=new sap.m.Menu({
                path : "/plants",
                title: "Notes For1234: ",
                template: new sap.m.MenuItem({                                        
                       text: "{description}",
                       })


            });
            that.getView().addDependent(menu);

            menu.setModel(thisOfBtn.getModel());
            const eDock = sap.ui.core.Popup.Dock;
            menu.openBy(oButton,false, eDock.BeginTop, eDock.BeginBottom, false);
        }

[代碼圖像] 1

菜單圖片在此處輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM