Author Topic: Column style applies to header automatically in 2.2.0  (Read 4573 times)

dbadmin

  • Pro Economy
  • Jr. Member
  • *
  • Posts: 67
    • View Profile
Column style applies to header automatically in 2.2.0
« on: November 17, 2014, 08:48:59 pm »
Is there any way to prevent it? Is it intended behavior or a bug?

I'd like to highlight cells in a column with a specific background color, but I'd like the header background to be the same all the time (default)

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6282
    • View Profile
Re: Column style applies to header automatically in 2.2.0
« Reply #1 on: November 17, 2014, 09:13:35 pm »
It depends upon how the css rule for the class is written:

This applies to grid body cells only
Code: [Select]
tr.pq-grid-row td.someClass {
  background: beige;
}

This applies to grid body cells as well as header cell.
Code: [Select]
tr td.someClass {
  background: beige;
}

dbadmin

  • Pro Economy
  • Jr. Member
  • *
  • Posts: 67
    • View Profile
Re: Column style applies to header automatically in 2.2.0
« Reply #2 on: November 22, 2014, 12:42:26 am »
That solved it!  Thanks.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6282
    • View Profile
Re: Column style applies to header automatically in 2.2.0
« Reply #3 on: May 27, 2015, 09:57:55 am »
If it's required to change style / apply css to header cells only, it can also be done with help of css.

tr.pq-grid-title-row > .pq-grid-col{
    background: pink;
}
tr.pq-grid-title-row > .pq-grid-col.green{ /* here green class is added in colModel definition */
    background: lightgreen;
}


Example:
http://jsfiddle.net/paramquery/qe1yur0L/1/