on 07-20-2017 9:09 AM
Hi,
Can someone please help on the below issue where I am not able to bind the data to the table?
For the table utility function:
function createMTable(tableID, colList, queryPath){
var RefreshDate = new Date();
var oTable;
var oModel = new sap.ui.model.xml.XMLModel();
oModel.loadData("/XMII/Illuminator?QueryTemplate="+queryPath+"&d="+RefreshDate+"&Content-Type=text/xml","",false);
oModel.setSizeLimit(50000);
if(sap.ui.getCore().byId(tableID) == null) {
oTable = new sap.m.Table({
id: tableID,
width : "100%",
columns: colList,
items: {
path: queryPath ,
template: new sap.m.ColumnListItem()
}
});
} else {
oTable = sap.ui.getCore().byId(tableID) ;
}
oModel.setData({
columns: colList,
rows: "/Rowset/Row"
});
oTable.setModel(oModel);
oTable.invalidate();
return oTable;
}
For the columns utility function :
function createMColumn(colID, labelText, valueElement) {
var oColumn = new sap.m.Column({
header: new sap.m.Label({text: labelText})
/****here we don't have template option to bind the value element from query
like this:
template: new sap.ui.commons.TextView().bindProperty("text", valueElement),
****/
how to define the template here?
});
return oColumn;
}
Thanks for your help,
Venkatesh
Hi,
I am unclear as of to your issue. You don't define a template in the sap.m.Column class.
You define the columns. In them, you define the ColumnListItem and in them a cell of type sap. ui.core .Control . In them, you can define a formatter, which is what you call a template. Please take a look at the samples and the documentation. If I have misunderstood you please narrow down the question to the most specific issue, so I can try and help you with.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.