如何在 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
    }
});

希望对您有所帮助!

更新于:2019 年 12 月 12 日

899 次浏览

开启您的 事业

完成课程并获得认证

开始吧
广告
© . All rights reserved.