SAPUI5平铺容器仅显示2个平铺

时间:2017-10-08 01:31:15

标签: sapui5

我从OpenUI5 Tile Container Sample

复制了相同的例子

但是我不能让它工作我只能看到2个瓷砖

我在不同的类似帖子中看到过建议将null添加到页面标记但不适用于我。

1 个答案:

答案 0 :(得分:1)

此问题是间歇性的,与Google Chrome相关。它与浏览器如何处理jQuery.sap.getModulePath()发出的异步请求有关。 我已经在Firefox Developer Edition中测试过,它运行正常。无论如何,这是如何解决它:

如果您在控制器中注释掉该行并将JSON数据定义到变量sPath它可以工作(我已经缩短了JSON数据以保持答案干净,但现场演示已满,请参阅下面的链接)。

Page.controller.js,第12行。

//var sPath = jQuery.sap.getModulePath("sap.m.sample.TileContainer", "/data.json");
var sPath = {"TileCollection":[{"icon":"sap-icon://hint","type":"Monitor","title":"Tiles: a modern UI design pattern for overview & navigation."},{"icon":"sap-icon://inbox","number":"89","title":"Approve Leave Requests","info":"Overdue","infoState":"Error"},{"type":"Create","title":"Create Leave Requests","info":"28 Days Left","infoState":"Success"},{"icon":"sap-icon://travel-expense-report","number":"281","numberUnit":"euro","title":"Travel Reimbursement","info":"1 day ago"},{"icon":"sap-icon://loan","number":"2380","numberUnit":"euro","title":"My Salary","info":"8 days ago"}]};

工作示例: Tile Container