samat
(Yeshenk S)
1
Please help to make pagination without all page refreshing ?
I tryed to do it, but all the method which i found in Internet didn’t help me.
I am a new in yii so if you can try to get very simple method.
Thank you
P.S: My apologize for this bad english
Hi,
The pagination is for your gridview? or where?
If that is the case follow the link
Ajax pagination
Cheers!
samat
(Yeshenk S)
3
this is my code in controller method:
$dataProvider0=new CActiveDataProvider('ImgCatalog', array(
'criteria' => array(
),
'pagination' => array(
'pageSize'=>9,
'pageVar' => 'list0',
)
));
$dataProvider1=new CActiveDataProvider('ImgCatalog', array(
'criteria' => array(
'condition' => 'category = "Бизнес"',
),
'pagination' => array(
'pageSize'=>9,
'pageVar' => 'list1',
)
));
$dataProvider4=new CActiveDataProvider('ImgCatalog', array(
'criteria' => array(
'condition' => 'category = "holiday"',
),
'pagination' => array(
'pageSize'=>9,
'pageVar' => 'list4',
)
));
$this->render('index',array(
'dataProvider0'=> $dataProvider0,
'dataProvider1'=> $dataProvider1,
'dataProvider4'=> $dataProvider4,
));
my code in index.php
<?php
$this->widget('zii.widgets.CListView', array(
'id'=>'list0',
'dataProvider'=>$dataProvider0,
'itemView'=>'_view',
'template'=>'{items}{summary}{pager}'
)); ?>
<?php
$this->widget('zii.widgets.CListView', array(
'id'=>'list1',
'dataProvider'=>$dataProvider1,
'itemView'=>'_view',
'template'=>'{items}{summary}{pager}'
)); ?>
<?php $this->widget('zii.widgets.CListView', array(
'id'=>'list4',
'dataProvider'=>$dataProvider4,
'itemView'=>'_view',
'template'=>'{items}{summary}{pager}'
)); ?>
so do you see some error?
Hi add a ajaxUpdate in Clistview widget
'id'=>'some id'//Give uniq id for all CListView because you using 3 list views
'ajaxUpdate'=>true, //Enable the ajax update