Author Topic: Render CSS According to Child Items  (Read 1867 times)

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Render CSS According to Child Items
« on: October 27, 2020, 03:11:24 pm »
Hello Team,

We have 3 level grouping and if Level 2 group summary have negative values than we require to show Level 1 font in Red color.

For Example we added a image for reference.

In image Sunil is in level 2 and having negative values and in this case Level 1 font summary require to show in negative according to respective columns.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Render CSS According to Child Items
« Reply #1 on: October 27, 2020, 04:29:39 pm »
Level 1 has pq_level: 0, level 2 has pq_level: 1 and so on.

Please use column.render for conditional css.

To check condition, iterate through children of ui.rowData in pq_level: 0 and if any of them has -ve value, return style object with

{ color: "#ff0000" }

Also refer to this example of conditional styles: https://paramquery.com/pro/demos/condition_style
« Last Edit: October 27, 2020, 04:31:28 pm by paramvir »

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Re: Render CSS According to Child Items
« Reply #2 on: October 27, 2020, 04:43:07 pm »
Hello Team,

Thanks for Quick Response. We aware of render functionality but our requirement is little change. Please check below details.

We did not want to change CSS according to current cell value.

We require to change CSS of pq_level:0 according to pq_level: 1 value.

If value of pq_level 1 summary is negative than for respective parent pq_level 0 column font we require to show in red color.


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Render CSS According to Child Items
« Reply #3 on: October 27, 2020, 04:56:33 pm »
In addition to current cell value, you can also check values of other rows ( iterate through children with pq_level:1 of ui.rowData with pq_level:0 ) in column.render callback.
« Last Edit: October 27, 2020, 04:59:45 pm by paramvir »