[gridView] -- DataColumn

来源:互联网 发布:疯狂java讲义精粹版 编辑:程序博客网 时间:2024/06/05 07:47

DataColumn类的作用是设置gridView生成的html代码的css样式


重写DataColumn代码

<?phpnamespace source\core\grid;class DataColumn extends \yii\grid\DataColumn{    public $headerOptions = [];    public $width = '60px';    public function init()    {        parent::init();                if (! isset($this->headerOptions['width']))        {            $this->headerOptions['width'] = $this->width;        }        $this->contentOptions=['style'=>'word-wrap: break-word; word-break: break-all;'];    }}


0 0
原创粉丝点击