cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m.table scroll to item

dirk_wieczorek
Participant
0 Kudos

I have 2 question concerning the sap.m.table.

I have an sap.m.table with a json model where the items are bound to the table with

template : new sap.m.ColumnListItem(

  { 

I have a function where i can insert new lines to this table.

The key of the table is "item" which is an integer.

The table is sorted by this key.

Is there a way to scroll / position the table so that the first visible line of the table is the newly inserted?

If there is a way can someone give me a hint how its done?

Second question if i need a filter / sorting function for this kind of table which the user can select do i need to code it or exists there anything

similiar to the sap.ui.commons.table where some functions are predefined?

best regards.

Dirk

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182372
Active Contributor
0 Kudos

  oPage.scrollToElement(oTable.getItems()[30], 200);

http://jsbin.com/mutega/edit?html,output

saivellanki
Active Contributor
0 Kudos

Hi Dirk,

For first question -

I guess this kind of behavior is not possible with table alone. You might need to use scroll container for it. Load the table content in Scroll Bar content aggregation and make use of scrollToElement method of scroll-bar.


Check sample here: JS Bin - Collaborative JavaScript Debugging


For second question -

Yes you have to manually code sorting/filtering and grouping functionalities for table. It doesn't come default as like of sap.ui.table.table.

Refer the code here - SAPUI5 Explored


Regards,

Sai Vellanki.