Alankar Singh, on 10 February 2013 - 02:51 PM, said:
No, in asset folder there are some files for zii grid view, i changed that but when i upload the same project on different server in asset folder new folder is generate for zii.
I just want a way by that if i fixed the layout of grid view then i dont need to change it on different servers.
Thanks
Ah ok, I see. Well then you can use my provided solution without any problems.
The approach in detail (assuming default paths)
protected/config/main.php
return array(
[...]
'import' => array('application.components.*'),
[...]
protected/componentns/GridView.php
Yii::import('zii.widgets.grid.CGridView');
class GridView extends CGridView
{
public function init()
{
$this->cssFile = Yii::app()->baseUrl . '/css/gridview.css';
parent::init();
}
}
css/gridview.css
Just copy&paste the content of your modified style.css in here.
Now simply search and replace all calls of
$this->widget('zii.widgets.grid.CGridView', array(...));
to
$this->widget('GridView', array(...));
Done.