There is the enableSorting
flag, that, if equals false, disable sorting for all grid columns. But how can I do this for just one specific column?
try this
'sortable'=>false,
Here is example ,
$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',
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With