OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – How do I? Questions add css class to report rows or cells

This topic contains 5 replies, has 4 voices, and was last updated by  farzam.sabeti 4 years, 11 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #36189

    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 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #36190

    Yevhen Shyshkin
    Participant

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

    #36191

    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

    #38780

    farzam.sabeti
    Participant

    Hi

    I was looking to add css class to report grid rows based on condition check in oro version 3.1. I did what you said but, that did not work. I expected to see the class name on the <tr> … </tr> tag but, nothing happened.

    Can you please guide me?

    Thanks

    #38793

    Hryhorii Hrebiniuk
    Participant

    Hi,

    Turned out, there’s bug. We’ll fix it.

    Here’s patch that fixes the issue:

    #38815

    farzam.sabeti
    Participant

    That works correctly. Thank you so much.

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

The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.

Back to top