So i am working in an app that uses de CGridView extensively but I am porting a webapp from a proprietary framework to Yii. So the CSS files are already written and have been working up until now.
The thing is that in my CGridView widget the headers of columns are enclosed in a TR tag and I have got no clue on where I can add a class attribute to this tag. I’ve read the documentation and now how to change each header cell individually but not the whole TR.
Thanks for your help!
Unfortunately you cannot do this directly, as there is no provision for adding attributes to the header row tags (see source code).
A straightforward solution would be to subclass
CGridViewas e.g.MyGridViewand override therenderTableHeadermethod to do what you need it to (add some class variables toMyGridViewto let it be configurable). I have used this approach many times in similar situations.