UI5 TreeTable scrolling to specified item in the model that binded to table programmatically

Viewed 907

I am using UI5 TreeTable to render show the data and i am instantiating like this

    <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>

But if I want to scroll to the specified row programmatically how can I achieve that?

1 Answers

You can do this using setFirstVisibleRow() e.g. set the first visible row to the 10th row

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