Disable sorting in header column of Yii CGridView

Rukmi Patel picture Rukmi Patel · Oct 1, 2012 · Viewed 12k times · Source

Yii provides sorting functionality for listing. How can I disable sorting so that my records will not get sorted when clicked on column header?

Answer

SuVeRa picture SuVeRa · Oct 1, 2012

set 'enableSorting' => false in your list/gridview definition.

$this->widget('zii.widgets.CListView', array(
        ......
        'enableSorting' => false,
        ......
    )
);