var table = this.getView().byId("myTableData");
var column = table.getColumns()[0];
所以我这里选择了第一列,但是如何得到这列的最后一个单元格呢?
我试过玩table.getRows()和映射索引,但问题是,我的列不一定能看到,所以这不是一个好的解决方案。
总之,感觉这里应该是更优雅的东西......。
<t:Table id="myTableData"
rows="{SomeData>/RowData}"
alternateRowColors="true"
rowSelectionChange="handleNewItemScaleSelectionChange">
<t:columns>
<t:Column width="100%" resizable="false" flexible="false" hAlign="Left" visible="{someModel>/visibility}">
<m:Text text="{someModel>Text}"/>
<t:template>
<m:Text text="{SomeModel>ThisData}" FontWeightBold" hAlign="Right" />
</t:template>
</t:Column>
<t:Column width="100%" resizable="false" flexible="false" hAlign="Right">
<m:Text text="hello"/>
<t:template>
<m:Text text="Hello"/>
</t:template>
</t:Column>
</t:columns>
</t:Table>
你可以使用 .length
获取行或列的最后索引。