Let's take a look the code that you should have to write down.
if(Yii::app()->request->isAjaxRequest){ $dataProvider=new CActiveDataProvider('KomentarThread',array( 'criteria'=>array( 'condition'=>'ID_THREAD=:id_thread', 'params'=>array(':id_thread'=>$model->ID_THREAD) ) )); $p=$dataProvider->pagination; $p->setItemCount($dataProvider->getTotalItemCount()); $p->currentPage=$p->pageCount-1; $this->renderPartial('/komentarThread/_comments_all',array( 'all_komentar'=>$dataProvider) ,false,true); Yii::app()->end(); }
The part of $p variable is to set your currentPage to the last page.
So enjoy your modification of your data provider...
thanks! this was helpful
ReplyDeletesetting the current page seems to prevent me from clicking to other pages?
Delete