ssossossossosso

Forums

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

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

  • Creator
    Topic
  • #30536

    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
  • #30537

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

    #30538

    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.