Skip to Content

UI5 - Table scrollbar position after navigation

Hi,

I have a semantic Detailpage with an sap.ui.table.Treetable control and vertical/Horizontal scrollbars.

User is able to navigate back and forth.

If e.g. the horizontal scollbar position was in the middle and user navihated back and forth the scrollbar is still in the middle and not on the initial left position.

How can I set the scrollbars to inital positions after each navigation?

Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Aug 30, 2017 at 10:51 AM

    I think refreshing the table on back navigation would be one option,

    or you can do it using jquery by setting the scroll position of an element.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Akhilesh,

      yes, that solved the problem.

      this.getView().byId("tableId").rerender();

      on nav back action.

      On sap.ui.table.Table this should also work for vertical scrollbar:

      oTable.setFirstVisibleRow(1)

      but it doesn`t work for TreeTable.