Skip to Content
1
Mar 05, 2019 at 07:20 PM

OpenUI5 Tree Table - get selected rows and their model data

2429 Views

For some hours now I'm trying to get the model data of selected rows of a tree table.

I used this example: https://sapui5.hana.ondemand.com/#/sample/sap.ui.table.sample.TreeTable.JSONTreeBinding/preview

Additionally, I added sortProperty and filterProperty to the columns. Until now everything works.

What I want to do is to submit the json data via ajax of all selected rows. for this, I need to get the json data of the selected rows.

What I tried:

var oTable =this.getView().byId("tableName").getSelectedIndicies()

and then

for(var i=0; i<=oTable.length; i++){this.getView().byId("tableName").getModel().getData().jobs[oTable[i]]}

it seems that when I use the sorter and filter function, the indicies are not correct anymore. The indicies keys won't change.

any idea how to solve my request? thx in advance!