Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8667

Re: Need to attach a css class to ListItems in HTML View

$
0
0

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 ?


Viewing all articles
Browse latest Browse all 8667

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>