cancel
Showing results for 
Search instead for 
Did you mean: 

How to update rows from user input

tridwip
Participant
0 Kudos

I am inserting data into table from user input via json model but every time a new input is given the previous row data is overwritten not concatenated tab.png. Can anybody help me? Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,Das

In Your Json model which binding u are using?(oneway binding or twoway binding).

if u are using two way binding,make it as oneway binding instead ofusing two way.

tridwip
Participant
0 Kudos

Thanks for the response...

this is my code in controller:

onPress: function()

{ var oTable = this.getView().byId("tstable");

var jModel= new sap.ui.model.json.JSONModel();

//var model = this.getView().getModel("jModel");

var typ= this.getView().byId("ityp").getValue();

var hrs= this.getView().byId("ihrs").getValue();

var aData = [{ date: "", from: "", to: "", hours:"", type:"", customer: "", project: "lux", description: "" }];

aData.push({type: typ, hours: hrs});

jModel.setData(aData);

oTable.setModel(jModel);