nishathul
(Nishathul)
1
Hi
how to change the default cgridview style , my code is paste here
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'email-queues-grid',
'dataProvider'=>$model->search(),
'columns'=>array(
'email',
'fetch_type',
'host',
'port',
array('name'=>'department',
'value'=>'$data->dept->department_title'
),
array(
'class'=>'CButtonColumn',
),
),
));
konapaz
(Konapaz)
2
Hi my friend
there are a few options for that like htmlOptions,itemsCssClass, … etc
check the related link
http://www.yiiframework.com/doc/api/1.1/CBaseListView#htmlOptions-detail
what exactly you want to do?
Best regards
fouss
(Jsfousseni)
3
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'email-queues-grid',
'dataProvider'=>$model->search(),
'cssFile'=>'the_path_to_you_css_file/you_css_file.css'// ex 'cssFile'=>'css/stylesGridCai.css',
'columns'=>array(
'email',
'fetch_type',
'host',
'port',
array('name'=>'department',
'value'=>'$data->dept->department_title'
),
array(
'class'=>'CButtonColumn',
),
),
));
nishathul
(Nishathul)
4
Hi i added extra field ‘itemsCssClass’=>‘class name’, as per the above replies and its working fine for me , updated code is
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'email-queues-grid',
'dataProvider'=>$model->search(),
'itemsCssClass'=>'table table-bordered',
'columns'=>array(
'email',
'fetch_type',
'host',
'port',
array('name'=>'department',
'value'=>'$data->dept->department_title'
),
array(
'class'=>'CButtonColumn',
),
),
));