cancel
Showing results for 
Search instead for 
Did you mean: 

UI5 Drop Down list Icon color

vinodkumar_thangavel
Participant
0 Kudos
336

Hi Experts,

I have a drop down list and its working fine as per the below code , Can you please let me know how to set the Icon color in the drop down list ?

Thanks & Regards,

Vinodkumar.

Accepted Solutions (1)

Accepted Solutions (1)

leonikussmaul
Product and Topic Expert
Product and Topic Expert

Hi Vinodkumar,

As far as I know, you will need to use CSS for this.

You can try adding a customData aggregation for your ListItem and set the property writeToDom="true". I have bound the status property of a JsonModel to the value property via expression binding so that the color would change accordingly. For more complex color coding, you can use a custom formatter.

view.xml

<core:customData>
<core:CustomData key="IconColor" value="{= ${IconModel>status} ? 'green' : 'red'}" writeToDom="true"/>
</core:customData>

style.css

[data-IconColor="red"]{
color:red;
}
[data-IconColor="green"]{
color:green;
}

Let me know if this worked.

Answers (0)