Skip to Content
0
Former Member
Apr 11, 2014 at 12:49 PM

sap.m.table - how to bind data?

948 Views

Hello experts,

I'm building sap.m.table in my JS View like this:


 
 
createContent : function(oController) { return new sap.m.Page("ContentPage",{ title: "Content", enableScrolling: false, showHeader: false, showNavButton: true, content: [ this.createTable()] }); }, createTable : function(){ var oTable = new sap.m.Table({ title : "Expiration Date", }); var columns = [{text: "SAP F&C ID", property: "StudyID"}, {text: "Study Code", property: "StudyNoCtms"}, {text: "Serial Number", property: "Medno"}, {text: "Material", property: "Matnr"}, {text: "Batch", proprety: "Charg"}, {text: "Expiration date", property: "Vfdat"}]; columns.forEach(function(column){ oTable.addColumn(new sap.m.Column({ header: new sap.m.Label({text: column.text}), })); }); // oTable.placeAt("content"); return oTable; }

Table is creating pretty good. Now how to bind oData service since sap.m.table has no method bindRows() like in sap.ui.table?

Regards

Mateusz