【发布时间】:2017-02-07 01:19:57
【问题描述】:
我想将嵌套在我的模型中的数组“机器”绑定到 SAPUI5 sap.m.TileContainer。
var data_main = {
"name":"1",
"company":{
"money":100000,
"name":"2",
"departments":{
"marketing":{
"marketingActivities":[
],
"marketingModifier":0,
"numberOfEmployees":1
},
"production":{
"output":14281.287062979532,
"outputCoefficientOfEmployees":10,
"machines":[
{
"priceForNextUpdate":0,
"effectOnOutput":200,
"level":1,
"price":0,
"name":"lauterTub",
"id":1,
"value":2000,
"costPerRound":100
},
{
"priceForNextUpdate":0,
"effectOnOutput":500,
"level":1,
"price":0,
"name":"fermantingVat",
"id":2,
"value":5000,
"costPerRound":200
},
{
"priceForNextUpdate":0,
"level":0,
"price":0,
"effectOnCapacity":0,
"name":"storage",
"id":3,
"value":0,
"costPerRound":0
},
{
"priceForNextUpdate":0,
"effectOnQuality":0,
"level":0,
"price":0,
"name":"beerFilter",
"id":4,
"value":0,
"costPerRound":0
},
{
"priceForNextUpdate":0,
"effectOnOutput":300,
"level":1,
"price":0,
"name":"brewingCopper",
"id":5,
"value":3000,
"costPerRound":200
},
{
"priceForNextUpdate":0,
"effectOnOutput":200,
"level":1,
"price":0,
"name":"mashTub",
"id":6,
"value":2000,
"costPerRound":50
},
{
"priceForNextUpdate":0,
"effectOnQuality":0,
"level":0,
"price":0,
"name":"whirlpool",
"id":7,
"value":0,
"costPerRound":0
},
{
"priceForNextUpdate":0,
"effectOnOutput":100,
"level":1,
"price":0,
"name":"maltMill",
"id":8,
"value":1000,
"costPerRound":50
}
],
"numberOfEmployees":2,
"quality":0,
"capacity":0
},
"procurement":{
"numberOfEmployees":1
},
"sales":{
"numberOfEmployees":2
}
},
"numberOfEmployees":6
},
"publicData":{
"markt":"Beispieleigenschaft des Marktes"
}
}
var model_main = new sap.ui.model.json.JSONModel(data_main);
sap.ui.getCore().setModel(model_main, "main");
在我看来:
new sap.m.TileContainer("tilecontainer_production", {
width: "55em",
height: "35em",
editable: true,
allowAdd: true,
tiles: {
path: "main>/company/departments/production/machines",
template: new sap.m.CustomTile({...})
)};
但是没有任何效果。我试图将它绑定到
- main>/机器
- 机器
- main>机器
- main>公司/部门/生产/机器
- main>/company/departments/production/machines/
但没有任何效果。
提前谢谢,我真的卡住了!
【问题讨论】:
标签: javascript json sapui5