The example in this article describes the method of setting Cgridview in Yii to prevent column sorting. Share to everyone for your reference, specific as follows:
The function of Cgridview in Yii is to display a list of the data. It supports sorting, paging, and AJAX data requests.
The following code shows how to set the Cgridview to prevent column sorting:
' Columns ' => array (
array (
' class ' => ' Ccheckboxcolumn ',
' selectablerows ' => ' 2 ', '
value ' =& Gt ' $data->id ',
' id ' => ' delete '
),
Array (
' header ' => ' title ',
' name ' => ' title ',
' Sortable ' =>false,//is set here
),
Array (
' class ' => ' Cbuttoncolumn '
)
,
More about Yii related content readers can view the site topics: "Yii framework Introduction and common skills Summary", "PHP Excellent Development Framework Summary", "Smarty Template Primer Tutorial", "PHP date and Time usage summary", "PHP object-oriented Programming Program", " Summary of PHP string usage, Introduction to PHP+MYSQL database operations, and a summary of PHP common database operations Tips
I hope this article will help you with the PHP program design based on the YII framework.