I am displaying activities in CGridView, the activities are in large number therefore I want the user to see the current date’s activities when the grid is displayed such that user can navigate back to old activities pressing “Previous” navigation button and also navigate forward by pressing “Next” button to see future activities but always see the current date first activity as the first row of the CGridView. How can I achieve this ?
Following is my code:
Loading Data
$ActivitiesList= new CActiveDataProvider('Activities',array('criteria'=>$criteria,));
Displaying the CGridView
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$ActivitiesList,
'id'=>'ActId',
'enableSorting'=>true,
'summaryText'=>'',
'enablePagination'=>true,
'columns'=>$columns,
'htmlOptions'=>array('style'=>'width:300;margin-top:-12px;'),
'emptyText'=>'No Activities Found.',
));