我想为表中的项目调用模板函数。但是我收到以下错误:
断言失败:列表绑定仅支持单个模板对象
<Table
id="treeTable"
items="{path:'nodeModel>/nodeRoot', parameters: {arrayNames:['children']}, template: '.resourceTemplate'}">
<columns>
<Column><Text text="Column1"/>
</Column>
<Column><Text text="Column2"/>
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Text text="Row1Col1"/>
<Text text="Row1Col2"/>
</cells>
</ColumnListItem>
</items>
</Table>
答案 0 :(得分:1)
仅使用XML或JS定义模板:
<Table
id="treeTable"
items="{path:'nodeModel>/nodeRoot', parameters: {arrayNames:['children']}, template: '.resourceTemplate'}">
<columns>
<Column><Text text="Column1"/>
</Column>
<Column><Text text="Column2"/>
</Column>
</columns>
</Table>