cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

SAP UI5 mark row selected

11-13-2020 7:44 PM
755 views 1 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hello experts,

Could you help me?

I need set a row in a table as "selected". But I can“t do it.

I know how to get row selected and remove the selections... but how I can mark?

var oTable = this.getView().byId("TableID");

var oContext = oTable.getSelectedContexts();

oTable.removeSelections(); oTable.setSelectContexts(1);

Thank you!

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

BGarcia
Active Contributor
0 Likes

Hi Celio,

Can you try one of the following options:

1) setSelectedItem
oTable.setSelectedItem(oTable.getItems()[0])
-> This would select first row (0)

2) setSelectedItemById
oTable.setSelectedItemById("__item0-__xmlview0--testTable-0");
-> This would select row with mentioned ID

Kind regards,
Garcia

Answers (0)