My controller code
public function actionRead() {
$criteria=new CDbCriteria(array(
'order'=>'id desc',
));
$enP=new CActiveDataProvider('Readss', array(
'criteria'=>$criteria,
'pagination'=>array(
'pageSize'=>1,
),
));
$this->renderPartial('_read', array('data'=>$enP));
}
it display the gridview properly ,
my view code
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'dfsdfsdf',
'dataProvider' => $data,
'itemsCssClass' => 'sdfsdfdl',
'ajaxUpdate' => false,
'template' => '{summary}{pager}{items}{summary}{pager}',
'columns'=>array(
array(
'header'=>'#',
'value'=>'++$row',
'htmlOptions'=>array(
'style'=>'width:50px;'
)
),
'name',
array(
'name'=>'Date',
'header'=>'Date',
'value'=>'Yii::app()->dateFormatter->format("d MMM y",strtotime($data["work_date"]))'
),
),
));
But when i click my pagination my page is refressing , what mistake i did here , I want to load data on click pagination without page refresh.
Hope this would work you can just make the 4rd argument true
//This will disable jquery being loaded again (use this if you have jquery already loaded
//means you are calling this in ajax)
//Yii::app()->clientScript->scriptMap['jquery.js'] = false;
//Yii::app()->clientScript->scriptMap['jquery.min.js'] = false;
$this->renderPartial('_read', array('data'=>$enP),false,true);
In your CGridView
you indicated to disable AJAX
by following line:
'ajaxUpdate' => false,
You must change it to TRUE
:
'ajaxUpdate' => true,