有enableSorting标志,如果等于false,则禁用对所有网格列的排序。但是,我如何才能在一个特定的专栏中做到这一点呢?
发布于 2014-05-19 18:07:40
尝尝这个
'sortable'=>false, 举个例子,
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'tasks-grid',
'dataProvider'=>$model->search(),
//'filter'=>$model,
'columns'=>array(
'id',
array(
'header'=>'Surname',
'value'=> '$data->surname',
'name'=> 'surname',
'sortable'=>false,
),
'due_date',
'status',
),https://stackoverflow.com/questions/23743974
复制相似问题