Reputation: 1225
I am trying to append constant "1:" to one of the table column values. My table column is :
var oTable = new sap.ui.table.Table({
selectionMode : sap.ui.table.SelectionMode.Single,
selectionBehavior: sap.ui.table.SelectionBehavior.Row
});
oTable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Rate"}),
template: new sap.ui.commons.TextField({value: "{RATE}"})
}));
Now on that above column i am trying to add constant as "1:". But if i try like as shown below, i don't get the desired result.
oTable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Rate"}),
template: new sap.ui.commons.TextField({value: "1:"+"{RATE}"})
}));
I intend to do this change in a clean way if possible? How can i achieve this? Looking forward to your solutions. Thanks in advance
Upvotes: 0
Views: 459
Reputation: 709
Try this solution it will work.
template: new sap.ui.commons.TextField({
value: {
path: 'RATE', //Binding Context field here
formatter: function(value){
return '1: ' + value;
}
}
})
Upvotes: 2