Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2638

how to add empty row to oData binded table without having to save it in the backend first?

$
0
0

Hi Community,

 

I need to your help again.

 

 

01-10-2015 12-17-48.png

 

 

 

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);

Viewing all articles
Browse latest Browse all 2638

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>