Firstly …
I have controller as
$model=new Profile();
$sql="select * from profile";
$count = Yii::app()->db->createCommand('SELECT COUNT(*) FROM profile')->queryScalar();
$rawData = Yii::app()->db->createCommand($sql);
$dataProviderRegSum = new CSqlDataProvider($rawData,
array('pagination'=>array('pageSize'=>4),
'totalItemCount'=>$count
));
if (Yii::app()->request->isAjaxRequest) {
$done =$this->renderPartial('gridshow', array('datapro' => $dataProviderRegSum,'model'=>$model), false,true);
}
else {
$this->render('gridshow',array('model'=>$model,'datapro'=>$dataProviderRegSum));
}
and in my view
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'family-record-grid',
'dataProvider'=>$datapro,
'enableSorting' => true,
//'cssFile' => $cssfile,
//'itemsCssClass'=>'tabchin',
// //'ajaxUpdate'=>true,
// 'pager' => array(
// 'firstPageLabel'=>'<<',
// 'prevPageLabel'=>'<',
// 'nextPageLabel'=>'>',
// 'lastPageLabel'=>'>>',
// 'maxButtonCount'=>'10',
// 'header'=>'<span>Pagination</span>',
// 'cssFile'=>Yii::app()->getBaseUrl(true).'/themes/phil/css/pager.css',
// ),
'ajaxUpdate'=>true,
'ajaxUpdateError'=>'js:function(){alert("Error");}',
'columns'=>()
));
but ajax pagination is not working …how to get ajax pagination for cgridview …where is the problem…please any help would be appreciated…