I have the same problem here :
I try to add an object formatter in the class property and it's not working.
See the code below :
<Text text="{
path:'0.90',
formatter: 'util.Formatter.pourcentage'}"
class="{
path:'0.90',
formatter: 'util.Formatter.colorbg'}">
</Text>
The formatter work for the text property but not for the class property ...
see the Formater function...
pourcentage : function (value) {
var numberFormat = sap.ui.core.format.NumberFormat.getFloatInstance({
maxFractionDigits: 2,
minFractionDigits: 2,
groupingEnabled: false,
groupingSeparator: ",",
decimalSeparator: "."
});
return numberFormat.format(value*100);
},
colorbg : function (value) {
if(value * 100 > 90)
{
return "green";
}
if(value * 100 < 80)
{
return "red";
}
if(value * 100 < 90)
{
return "orange";
}
return "red";
},
Anybody know why the property class wont take an object formatter ?