i am try below code but i getting error
controller.js
Delete:function(oEvent) |
{
var tbl=sap.ui.getCore().byId("tableId"); | |
var idx = tbl.getSelectedIndex(); |
if (idx !== -1) {
var m = tbl.getModel();
var data = m.getData();
var removed = data.splice(idx, 1);
m.setData(data);
alert(JSON.stringify(removed[0]) + 'is removed');
} else {
alert('Please select a row');
} | } |