Hello all,
I have pagination problem. after update page is not back to original page, it backs to 1st page. Please help me.
here is my view file
in model
public function searchName()
{
$criteria=new CDbCriteria;
$criteria->compare('name',$this->name,true);
$criteria->addCondition('id = 1);
return new CActiveDataProvider('Address', array(
'criteria'=>$criteria,
'pagination'=>array(
'pageSize'=>5,
),
));
}
in controller for update
public function actionUpdate()
{
$model=$this->loadModel();
// Uncomment the following line if AJAX validation is needed
if(isset($_POST['Address']))
{
$model->attributes=$_POST['Address'];
if($model->save())
$this->redirect(array('admin','id'=>$model->id));
}
$this->layout='bare'; // this layout allows for a clean look in an iframe
$this->render('update',array(
'model'=>$model,
'update'=>true,
));
}