cancel
Showing results for 
Search instead for 
Did you mean: 

After clicking save only CRUD operations has to perform? how?

Former Member
0 Kudos

onRowsDeleteButton: function(oEvent) {

this.saveEnbaled();

var oTable = this.getView().byId("invoiceList");

var aSelectedIndices = oTable.getSelectedItems();

var oModel = oTable.getModel();

var aBatchtoDelete = [];

for (var i = 0; i < aSelectedIndices.length; i++) { var oContext = aSelectedIndices[i].getBindingContext().getPath(); oModel.remove(oContext, 'DELETE');

}

}

irfan_gokak
Contributor
0 Kudos

Hi,

Please provide more details. It’s not clear.

Accepted Solutions (1)

Accepted Solutions (1)

former_member484715
Contributor
0 Kudos

I did'nt understand what is your requirement exactly. From what I understand, you can create an submit button in the view, an clicking, in the controller, call the remove function in the OData model to delete the table row.

Former Member
0 Kudos

Thanks Arjun for reply.

When I delete table row it is deleting in oData service table directly. This should happen when I click on submit / save button. I am not able to build that lagic in my function.

Thank you very much for your answers.

former_member484715
Contributor
0 Kudos

Welcome Sudhakara Reddy B,

What you can do is delete only your row first i.e. donot call your OData CURD methods there. Call the CURD methods on clicking of the submit button. You can view the foll. links for better understanding of the coding part :

https://sapui5.netweaver.ondemand.com/sdk/#/sample/sap.m.sample.ListDeletion/preview

https://blogs.sap.com/2016/10/11/addremove-rows-sap.m.table-quick-reference/

https://gist.github.com/dennisseah/d0981ffd942d4a021f1d

Hope this helps,

Regards.

Answers (0)