Question

In my CGridView the table generated by the grid method is using a default css class named .grid-view. Is it possible to change the class name? In my page, I am using two grid views and the theme of the grid view is different, one in a green color and the other in red. How can I do that?

Was it helpful?

Solution

Please take a look of this documentation http://www.yiiframework.com/doc/api/1.1/CGridView

You can change the class of your filterCssClass, loadingCssClass, itemsCssClass, etc. Just add the specific attribute to your widget.

$this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider'=>$dataProvider,
    'columns'=>array(),
    'loadingCssClass'=>'loading-class',
    'itemsCssClass'=>'item-class'
));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top