I am new to UI5, JS and web developing in general. Following courses on openSAP about SAPUI5, I got this page:
The city names are displayed in the tags list/secondStatues/ObjectStatues
.
I would like to turn city's name color into red if it is "Berlin"
.
Find here the concerned XML View and the controller.js I'm getting an issue from:
XML view sample:
<List>
<!-- ... -->
<secondStatus>
<ObjectStatus
title="{i18n>statusDeliveryFrom}"
text="{
parts: [
{
path: 'ToSupplier/Address/City'
}
],
formatter2: '.formatter.cityColor'
}"
/>
</secondStatus>
</List>
NB: I put formatter2
because there is another formatter
controller.js sample:
cityColor : function(vText){
if (vText === "Berlin") {
return "#FF0000";
}
},
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…