Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 2 replies, has 2 voices, and was last updated by Ahmad Golzar Ahmad Golzar 1 year, 9 months ago.

  • Creator
  • #16448
    Ahmad Golzar
    Ahmad Golzar


    Is it possible to add css class to report grid rows or cells based on condition check? We need to check a condition and for example set background color for rows.

    Any suggestion?


Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #16452
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core


    The easiest way to do that is to pass column called “row_class_name” to frontend – in this case this column value will be added to grid row class, so you can apply your own styles to this row. If you need to apply this styles to some specific grid – you can write it right into grid configuration, if no – you need to listen to datagrid event (probably, PreBuild) and alter grid configuration there.


    And result:

    If you need to do something more sophisticated that includes JS code – you should add JS datagrid builder and customize grid from frontend side there (example of datagrid builder module).

    Ahmad Golzar
    Ahmad Golzar

    Dear Yevhen,

    Thank you so much for your perfect reply. The “row_class_name” solution is exactly what we were looking for and should cover our needs.

    Thanks again,

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.