Hi Community,
I need to your help again.
I have a grid table binded to oDataModel, which is working fine and showing data as expected. Now I need your help to implement the creation of new entry.
Basically, when the user press "Add Cost Type", a new empty row should be added to the bottom of the table. This row should get saved to backend once the user press "save".
I have seen several examples with JSONModel but didn't had much luck with ODataModel. Any help is highly appreciated.
Here is my "Add Cost Type" function:
var oModel = this.getView().getModel(); var rowCount = this.getView().byId("idCostPerUnitsTable").getBinding("rows").getLength(); rowCount = rowCount + 1; var vProperties = {}; vProperties.SapCostUnitId = rowCount; alert("row id " + rowCount); oModel.createEntry("/CostPerUnits", vProperties);