我有一个带有TreeTable
的XML视图。绑定带有一个oData,该数据返回一个类似results-->
的东西,然后在每个结果中返回一个称为“ ABC”的东西,它本身就是一个数组。
在我的表中,我想显示父行和行(没有子行)的results-->
字段。对于子行,需要显示results--> ABC --
>,然后显示属性绑定。但是,按照我编写代码的方式,它对于具有子项的行(父级和子级绑定很好)有效,但是对于没有子级的行,某些控件也变得可见。我不确定如何设置可见语法。
XML视图:
<table:TreeTable rows="{path:'List>/results', parameters:{arrayNames:['ABC']}}" >
<table:Column id="t1" width="200px">
<Label text="Column1"/>
<table:template>
<HBox>
//want to make visible only for parent and the row which does not have child
<Text text="{path: 'List>', formatter: '.formatCoumn1'}" visible="{= !${List>?????}}"/>
//want to make visible only for child row
<DatePicker value="{List>ExpiryDate}" visible="{List>?????}"/>
</HBox>
</table:template>
</table:Column>
答案 0 :(得分:0)
<Text text="{path: 'List>ABC'}" visible="{= ${List>switch} !== undefined}"/>
<DatePicker value="{List>ExpiryDate}" visible="{= ${List>switch} === undefined}" />
演示工具包中的What is the difference between .// and //* in XPath?还有一些其他示例,可能对您有用:
enabled="{= ${/orderStatus} !== null }"
enabled="{= ${/items}.length > 0 }"