如何在 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.