Hello Experts, I am trying to use a table UI element and trying to read the row selected. However the below code does not seem to work.
Also I dont see any entry in firebug DOM for console variable rowselect.
var oTable = new sap.ui.table.Table({
id: "Customers",
title: "Customers",
visibleRowCount: 7,
firstVisibleRow: 3,
selectionMode: sap.ui.table.SelectionMode.Single,
});
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData({modelData: aData});
oTable.setModel(oModel);
oTable.bindRows("/modelData");
oTable.sort(oTable.getColumns()[1]);
oTable.placeAt("master");
oTable.attachRowSelect(function(oEvent) {
var rowselect = oEvent.getParameter("rowContext");
oTable.setBindingContext(rowselect);
console.log(rowselect);
});
.......
Also tried: selectedContext = oTable.getContextByIndex(oTable.getSelectedIndex()); the problem is I dont get "getSelectedIndex option in oTable.
Any pointers?
thanks, Justin