How to use a double formatter in SAPUI5?

631 views Asked by At

I am trying to use a double formatter for a StandardListItem, based on certain conditions (which will be evaluated in javascript), I want a CSS class to be applied.

my code is as below.

<StandardListItem 

class = "{= '{path: \'' + ${path: 'lineItem>', formatter: 'path.to.formatter'} + '\', formatter: \'.anotherFormatter\'}' }"

 icon = "{= '{path: \'' + ${path: 'lineItem>', formatter: 'path.to.formatter'} + '\', formatter: \'.anotherFormatter\'}' }"> 

</StandardListItem>

In the above case, the formatters for icon are being called, but for class, the formatters are not being called, is it something which is not supported or am I doing something wrong?

1

There are 1 answers

0
matbtt On

The attribute "class" is currently not bindable, but you can use method addStyleClass to add your specific CSS class. If you don't want to do that you could also write custom data to the DOM and use this data as described in the example.