我试图将两个模型属性连接到一个字符串中,这将是我的项目列表的名称,但是我做不到正确的方法:

<List items="{= '{oModel>/' ${oModel>/class} '}'" ></List>

有什么办法可以在XML View中进行此串联,所以例如,如果ABC是oModel> / class属性中的值,我将获得{oModel> / ABC}作为列表项。

谢谢

最佳答案

您无法在视图中进行所需的操作。

就像@inizio提到的那样,您可以像这样在控制器中实现它:

var sClass = this.getModel('oModel').getProperty('/class');
this.byId('id-of-list').bindItems({
   path: "oModel>/" + sClass",
   template: ...,
)}

关于javascript - 如何在XML View 中连接属性值,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58844584/

10-13 04:15