Skip to Content
0
Former Member
Nov 11, 2013 at 06:30 PM

How to read the data from selected SAPUI5 table row

14955 Views

Hi,

I would like to read the data from the selected row in SAPUI5 table. I have defined a table in JS view as:

var

sysTable = new DataTable({

title:

"SAP System List",

visibleRowCount: 10,

selectionMode: SelectionMode.Single,

editable : true

});

The table is binded to JSON data

sysTable.bindRows("/SystemDetails");

I have also used the attachRowSelect function to get the selected row indices.

sysTable.attachRowSelect(function(oEvent){

oSystemDetailsML.bindContext(

"/SystemDetails/" + sysTable.getSelectedIndices());

});

Lets say the table has two columns as "SysID" and "Description". I am not able to read the data for the selected row.

Tried using the command alert(sap.ui.getCore().byId("SysID").getValue()); but not sure how this will read the data from selected row.

Thanks,

Yomesh