Skip to Content
0
Sep 13, 2017 at 09:40 AM

how to bind rows with dynamic json data?

225 Views Last edit Sep 13, 2017 at 09:42 AM 2 rev

I have tried this

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

var date= this.getView().byId("DP1").getValue();

var to = this.getView().byId("to").getValue();

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

var frm = this.getView().byId("frm").getValue();

var prj = this.getView().byId("prj").getValue();

var des = this.getView().byId("des").getValue();

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

var data = {d: {

date: date,

from: "",

to: "",

type:typ,

customer: "",

project: "",

internal: "",

description: "" }};

jModel.setData(data);

oTable.setModel(jModel);

oTable.bindRows("/data"); },

////////////////////

the error in the console is "oTable.bindRows is not a function"