ssossossosso

Forums

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
    Topic
  • #16448
    Ahmad Golzar
    Ahmad Golzar
    Participant

    Hi,

    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?

    Thanks

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

    Hello.

    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.

    Example:

    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).

    #16460
    Ahmad Golzar
    Ahmad Golzar
    Participant

    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,
    Ahmad

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

You must be logged in to reply to this topic.