The Data that need to be displayed on SAPUI5 Table control resides of a backend system. The Data is fetched via oData services read call and rendered in table UI Control in below fashion
oModelECST_FETCH.read(url5,null, null, true, function(oData, oResponse){ debugger;
oInvoices = new sap.ui.model.json.JSONModel({ "Invoices" : oData.results }); oInvoices.iSizeLimit = 100000;
var tab =this.getView().byId("invoicestable"); // invoicestable is the ID of Table UI Control
tab.setModel(oInvoices);
var i=0;
tab.bindAggregation("items", {
path: "/Invoices",
template: new sap.m.ColumnListItem({
cells: [
//
new sap.m.CheckBox({visible:invoicesThat.strtoBool(oData.results[tableIndex1].Count)}).setSelected(true),
new sap.m.CheckBox("cbinv",{visible:"{Count}", selected:"{Sel}"}),
new sap.ui.commons.TextView({ text: "{InvNo}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{InvDate}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{Tin}" , design:"Standard", semanticColor:"{semCol}"}),
// new sap.ui.commons.TextView({ text: "{FormNum}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text:"{TypeOfTx}",design:"Standard",semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{TaxableGoodsVal}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{AmtTaxVal}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{InclTaxVal}", design:"Standard", semanticColor:"Default", visible:inctaxval}),
new sap.ui.commons.TextView({ text: "{LabourChrgesVal}", design:"Standard", semanticColor:"Default",visible:labchargval}),
new sap.ui.commons.TextView({ text: "{OtherChrgesVal}", design:"Standard", semanticColor:"Default"}),
//new sap.ui.commons.TextView({ text: "{LabourChrgesVal}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{GrossTotalVal}", design:"Standard", semanticColor:"Default"}),
]
})
});
},function(err){
debugger;
});
oModelECST_FETCH.read(url5,null, null, true, function(oData, oResponse){ debugger;
oInvoices = new sap.ui.model.json.JSONModel({ "Invoices" : oData.results }); oInvoices.iSizeLimit = 100000;
var tab =this.getView().byId("invoicestable"); // invoicestable is the ID of Table UI Control
tab.setModel(oInvoices);
var i=0;
tab.bindAggregation("items", {
path: "/Invoices",
template: new sap.m.ColumnListItem({
cells: [
//
new sap.m.CheckBox({visible:invoicesThat.strtoBool(oData.results[tableIndex1].Count)}).setSelected(true),
new sap.m.CheckBox("cbinv",{visible:"{Count}", selected:"{Sel}"}),
new sap.ui.commons.TextView({ text: "{InvNo}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{InvDate}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{Tin}" , design:"Standard", semanticColor:"{semCol}"}),
// new sap.ui.commons.TextView({ text: "{FormNum}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text:"{TypeOfTx}",design:"Standard",semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{TaxableGoodsVal}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{AmtTaxVal}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{InclTaxVal}", design:"Standard", semanticColor:"Default", visible:inctaxval}),
new sap.ui.commons.TextView({ text: "{LabourChrgesVal}", design:"Standard", semanticColor:"Default",visible:labchargval}),
new sap.ui.commons.TextView({ text: "{OtherChrgesVal}", design:"Standard", semanticColor:"Default"}),
//new sap.ui.commons.TextView({ text: "{LabourChrgesVal}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{GrossTotalVal}", design:"Standard", semanticColor:"Default"}),
]
})
});
},function(err){
debugger;
});