how ti add class css with condition

Jaffrezic asked on July 30, 2019

Hello,
 
how to replace measure cell content with an icon for example using font awesome classes (‘fa fa-check’ or ‘fa fa-calendar’) depending on condition (when value === 1 then display check icon when value ===2 display calendar icon.)
 
Thank you.

5 answers

Public
Vera Didenko Flexmonster July 30, 2019

Hello,
 
Thank you for your question.
 
Please see the answer in the following thread: https://www.flexmonster.com/question/how-to-replace-measure-cell-content-with-an-icon/
 
Let us know if this helps.
 
Best Regards,
Vera

Public
Jaffrezic July 30, 2019

Hi Vera
Thanks for your answer, but I know we can do it by customizeCell() API call.
But I would like to do it with conditional format object.
something like this for exemple : 
 

measure.conditions = [
{
  formula:’#value < 0′,
  format: {
    classCSS:”fa fa-calendar”
 }
}]

 
Thanks
 
Franck

Public
Vera Didenko Flexmonster July 30, 2019

Hello,
 
Thank you for your response.
 
At the moment, the format property is a style object that can only have the following properties:

"format": {
"backgroundColor": "#FFFFFF",
"color": "#0000FF",
"fontFamily": "Arial",
"fontSize": "12px"
}

With conditional formatting, you can specify the font size, font color, font family, and background color.
 
In case the cell content needs to be changed (for example, replacing the text with icons), we kindly recommend using the customizeCell() API call.
 
Please let us know if you have further questions.
 
Best Regards,
Vera

Public
Jaffrezic July 31, 2019

Hi Vera
Thanks for your answer.
Would it be possible in a future version of flexmonster to develop this feature ?
Franck

Public
Vera Didenko Flexmonster July 31, 2019

Hello, Fran​ck,
 
Thank you for your question.
 
Our team would like to explain that our roadmap is full at the moment.
We have added your request to our customers’ wishlist and we will notify you in case of any changes on the matter.
 
You are welcome to contact us in case any questions arise.
 
Best Regards,
Vera

Please login or Register to Submit Answer