ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: kiwon34 on July 17, 2017, 04:57:38 pm
-
Hello,
Is there a way to change the style(ex. color, font, etc) of each header cell? I want to change the style for each header directly by script.
Is there a simple way to do so?
-
With css:
Assign column.cls ( e.g., someClass ) and write css rules that are applicable to header cells only.
.pq-grid-col.someClass{
font-size: 15px;
...
}
With script:
Get reference to header cell with getCellHeader
https://paramquery.com/pro/api#method-getCellHeader
and assign css ( use jQuery css method ) in refreshHeader event of the grid.
grid.on('refreshHeader', function(){
this.getCellHeader({}).css(.. your custom css ..);
})
-
Thank you very much! It helped a lot.
-
There is easier and convenient API in v7 for header cells.
https://paramquery.com/pro/api#option-column-styleHead