on 09-13-2017 10:40 AM
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"
Is this sap.m.Table or sap.ui.table.Table?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tridwip Das
If its sap.m table than there is no method known as bindRows it has bindItems ... Actually sap.m.table is designed as list which has the aggregation items not rows where as the sap.ui.table is designed as proper tables with rows and columns both as aggregations .. please refer api reference of table : https://sapui5.hana.ondemand.com/#/api/sap.m.Table
Tip :
And also a tip for you after seeing your code in the query : don't get values the way you are doing currently like for getting date you are getting the value of the control date (this.getView.byId("DP1")) instead of that use models (json model) ..
Through models you will always get the updated values whereas getting values by control id will give you the value attach to the control which will be static even if the values gets changed ..
Thanks
Viplove khushalani
tab.png I need to update those rows not replace
You must be using the sap.m.table. You need to use bindItems and not bindRows.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
uhm, your JSon is not rigth, it is not an Array 😉 Furthermore, the path on your Binding is wrong it should be this :
oTable.bindRows("/"); },
If you do not want to modify your binding, your JSon should be this :
{ data : [ { date : '', from : '', ...}, { date : '', from : '', ...}, ... ]}
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.