数据绑定在UI5中

huangapple go评论54阅读模式
英文:

Data binding in UI5

问题

我有一个来自API的数据输出,如下所示,在jsonModel的samplemodel中:

[
{
“Info” : { Id: “id1”, val: [. {id:”subid1”,name : “name1”}]}
},
{
“Info” : { Id: “id2”, val: [. {id:”subid2”,name : “name2”}]}
}
]

我如何通过将值绑定到sap.m.table来显示数据。尝试以下操作:

<Table items="{path:'samplemodel>'}">
<Text text="{samplemodel>/Info/Id}">

请注意,你提供的JSON数据中有一些问题,例如双引号应该使用英文双引号而不是中文双引号,并且在JSON路径中应该使用斜杠 / 而不是大于号 >. 如果你能提供更准确的JSON数据和路径,我可以帮助你更好地进行绑定。

英文:

I have an data output from an api as below In the jsonModel samplemodel :

[ 
{
“Info” : { Id: “id1”, val: [.      {id:”subid1”,name : “name1”}]}
},
{
“Info” : { Id: “id2”, val: [.     {id:”subid2”,name : “name2”}]}
}
]

How do I display by binding the values to sap.m.table . Tried the following

&lt;Table     items=“{path:’samplemodel&gt;/‘ }”
  &lt;Text text:“{samplemodel&gt;/info&gt;id}”&gt;

答案1

得分: 1

<Text text:"{samplemodel>info/id}">

英文:
 &lt;Text text:“{samplemodel&gt;info/id}”&gt;

huangapple
  • 本文由 发表于 2023年2月24日 13:28:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/75552910.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定