I have a CGridView which I am passing a CActiveDataProvider object to that contains data returned from a database query. When I click a column header the table is sorted by that particular column, however when I click "Next" the pagination seems to lose the sorting order. Is there a way to maintain the sorting order while paging?
The page index is give by a variable ending in _page ; for a filter having ‘Devices’ as the model type, it is: [size=2]Devices_page=2 . The sort order would be set in Devices_sort= .[/size]
[size=2]
[/size]
[size=2]Normally this functionnality works out of the box, the ‘setState’ suggestion is only needed when you want to remember the page that you were on the next page visit.[/size]