UI5 TreeTable滚动到模型中以编程方式绑定到表的指定项目

时间:2017-07-21 03:58:26

标签: javascript jquery scrollbar sapui5 treetable

我使用UI5 TreeTable渲染显示数据,我正在实例化

    <table:TreeTable 
        visibleRowCountMode="Auto"
        selectionMode="Single"
        enableSelectAll="false"
        minAutoRowCount="-1"
        rowHeight="40" 
        columnHeaderHeight="40"
        height="100%"
        rows="{/rows}">
        <table:columns>
            <table:Column width="30%"  id="dataListColumn">
                //column template
            </table:Column>
            <table:Column  resizable="false" flexible="false">
                    //column template   
            </table:Column>
        </table:columns>
    </table:TreeTable>

但是如果我想以编程方式滚动到指定的行,我该如何实现呢?

1 个答案:

答案 0 :(得分:0)

您可以使用setFirstVisibleRow()例如将第一行显示为第十行

this.getView().byId("YourTable").setFirstVisibleRow(10)