如何在 SAPUI5 中建立列表?


已閱讀完你的程式碼,你的列表繫結似乎不正確。當你繫結資料時,你的資料應採用 JSON 陣列格式。請在下方的更新後的工作程式碼中找出答案。

示例

var oModelData =
[
  {Animal: "Kangaroo", Zoo: "Sydney"},
  {Animal: "Tiger", Zoo: "Melbourne"},
  {Animal: "Lion", Zoo: "Alaska"}
];
var oItem = new sap.m.StandardListItem({
   title : "{ Animal }",
   description : "{ Zoo }"
});
var oList = new sap.m.List({
   headerText:" Items",
   items: {
        path: "/",
        template: oItem
    }
});

希望能幫到你!

更新於: 12-Dec-2019

899 次瀏覽

開啟你的職業生涯

完成課程後獲得認證

開始吧
廣告
© . All rights reserved.