Reputation: 77
I have a sap.m.table which has content in it, i want to add a column in the same table with sr.no and it should increment and decrement automatically when data is added and deleted respectively.The number should be added dynamically as per the data in the table. can anyone suggest me good solution for this problem.
Upvotes: 1
Views: 1340
Reputation: 400
Get your table's sPath from oContext...
For Example:
oTable.bindAggregation("items", {
path: "/", //json is an array of rows
factory: function(sId, oContext) { //this function is applied to each row
var sPathindex = oContext.getPath();
var index = parseInt(sPathindex.substring(1))+1;
var serialNo = new sap.m.Text({text: index });
}
return colListItem = new sap.m.ColumnListItem({
cells:[serialNo ]
});
}
Hope this will helps you to solve your problem
Upvotes: 1