
Moderator







2 years, 5 months ago
#36781
::
Hi Mehwish,
In the process described in the screenshot above, you just subscribe to the delete event of the table and get the selected list item. You still need to add the logic to delete the item in the table model.
For example, in the script of the widget ‘TableEnhanced’, you can find the following function that deletes an item:
//public delete item method
deleteItem: function(oEvent) {
//init vars
var oListItem = oEvent.getParameters().listItem,
index = this.indexOfItem(oListItem),
oBindingInfo = this.getBindingInfo("items"),
oModel = this.getBinding("items").getModel(),
oData = oModel.getProperty(oBindingInfo.path) || [];
//remove item
oData.splice(index, 1);
//set data
oModel.setProperty(oBindingInfo.path, oData);
}
You can adapt this function for your context and append it to your delete logic. This function basically needs the index of the selected list item to delete the entry in the table model.
We are planning to include the delete logic in the TableEnhanced, but it will take some time until the adapted widget will be released.