phpyiiyii-extensionsyii-componentsyii-events

Disable sorting in header column of Yii CGridView


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


Solution

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

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