General Category > Help for ParamQuery Pro

Conditional Cell Formatting

<< < (4/5) > >>

mikep:
Disregard my last request. At the moment I don't need to apply this grouping granularity. Thanks again.

mikep:
For grouped rows: I would like to change the background of the grouping row to red if two particular columns are not equal AND if the group row is grouped by a particular column.
In my jsfiddle, if month1 <> month 2 AND is grouped by Rank, then color red.

https://jsfiddle.net/z3w2Lthc/

paramvir:

--- Code: ---rowInit: function(ui) {
  var rd = ui.rowData;
  if (rd.pq_gtitle) {
    if ((rd.month1 != rd.month2) && (this.option('groupModel.dataIndx').indexOf('rank') >= 0))
      return {
        style: 'background:red;'
      }
    else
      return {
        style: 'background:#ff9812;'
      }
  }
},

--- End code ---

https://jsfiddle.net/nmyj7ezh/2/

mikep:
Thank you. What is the syntax If I only want to color 1 column (month1) red in the grouping row? I tried a render function for the column but could figure out the group logic.

paramvir:
Same syntax.

move same code to column.render callback:

https://jsfiddle.net/4sfkjn90/

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version