Skip to Content
0
May 25, 2020 at 12:08 PM

unable to delete entry from table row for Product Sets

232 Views

Hello Team,
I have created a Products Table via binding the "ProductSet" entity set. The requirement is to delete a selected row from the table, However when i am trying to do that i am receiving an error as "Uncaught TypeError: obindingcontext.delete is not a function". I have debugged and checked the code ".delete" is not getting executed.

I am attaching the screenshots and controller logic, requesting you to please help me in this.

onpressdelete: function () {
var oTable = this.getView().byId("table"),
obindingcontext = oTable.getSelectedItem().getBindingContext();

obindingcontext.delete("$auto").then(function () {
oTable.removeSelections();
MessageBox.alert("Deleted Product Item", {
icon: MessageBox.Icon.SUCCESS,
title: "Success"
});
}, function (oError) {
MessageBox.alert("Could not delete Prod: " + oError.message, {
icon: MessageBox.Icon.ERROR,
title: "Error"
});
});

Thanks & Regards,
Subrata Roy


[1]: https://i.stack.imgur.com/iNn05.png

Attachments

error.png (155.7 kB)