Skip to Content
0
Former Member
Dec 21, 2016 at 11:19 AM

How to append a constant value to a SAPUI5 table's column value

485 Views

Hi all,

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