cancel
Showing results for 
Search instead for 
Did you mean: 

back ground color for ui5 control based on attribute value

prasad
Participant
0 Kudos

Hi all,

I have a object header sap.m.object header , how can i add a css class to this control based on the value of a attribute or number field

for example

var  ticket_details = new sap.m.ObjectHeader('ticket_details', {

  title:"{Ticket}",

  intro:"{Type}",

attributes : [

    new sap.m.ObjectAttribute({

    title:"",

     text : "{value}",

     })

        ],

  });

how can i  change the background color or any css property to object header based on the attribute text value . so if the value is greater than 90 the object header background should changed to red like wise..

Thanks

Prasad

Accepted Solutions (1)

Accepted Solutions (1)

saivellanki
Active Contributor
0 Kudos

Hi Prasad,

Modified the sample which I gave you few days back: Plunker

Regards,

Sai Vellanki.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi prasad,

You can use custom formatter function like this

JS Bin - Collaborative JavaScript Debugging

Regards