I need the records showing listings in the admin view's CGridView to be sorted alphabetically (ascending or descending) on any of the fields. Could you help me?.
I need the records showing listings in the admin view's CGridView to be sorted alphabetically (ascending or descending) on any of the fields. Could you help me?.
Update your function
search()
in the model and add the following code:And inside the admin view change the
dataprovider
to:English source: https://stackoverflow.com/questions/18822334/yii-change-default-order-in-cgridview