Daniel
Daniel

Reputation: 2467

SAPUI5 table: get none-displayed values of selected row?

I have a SAPUI5 (OpenUI5) application with a table. This table is bound to a (JSON) model and display the name of the entity and some other attribute - but not the technical key. The user should have the opportunity to select multiple lines in the table and the application should then be able to get the technical keys of the selected lines (probably using the underlying model). How would I do such a thing?

Thanks in advance!

Upvotes: 1

Views: 3870

Answers (2)

Qualiture
Qualiture

Reputation: 4920

The rowSelectionChange event has a rowContext attribute. A better approach would be

  rowSelectionChange: function(oEvent) {
    console.log(oEvent.getParameters().rowContext.getProperty("your_key"));
  }

to obtain the value of your key (or any field in the selected row by adapting the getProperty value accordingly)

Upvotes: 2

SPEC
SPEC

Reputation: 75

when you will select a row in a table, there is a event called "rowSelectionChange". Use this event and getSelectedInedx of row. Using the index value loop over your json and get values selected row.

Upvotes: 0

Related Questions