This is extension inspired by "mypager"
Requirements ¶
...requirements of using this extension (e.g. Yii 1.1 or above)...
Usage ¶
using simple 4 steps you can change your pager. Please follow the steps 1step: Import Extension by adding following line to your application configuration:
'import'=>array(
'application.extensions.*',
'application.extensions.AjaxList.AjaxList'
),
step2: add following code at the top of your view file
$dataProvider = $model->search();
$pageSize = Yii::app()->user->getState("pageSize",@$_GET["pageSize"]);
$dataProvider->getPagination()->setPageSize($pageSize);
step3: change the data Provider of your grid
'dataProvider'=>$dataProvider,// it's before $dataProvider = $model->search();
step4: This is final step. You just need to change the pager class to AjaxList
'pager'=>array(
'class'=>'AjaxList',
'maxButtonCount'=>25,
'header'=>''
),
Demo ScreenShot:-
This what we need to do to.
Let me know for any modifications....
Great extension
I really like this extension, is there any way to make a "show all" button easily?
Show all
Yeah we can make that... I will provide upgrade version..
Aww
I really appreciate it, but I figured out how to do it. It was actually really easy once I located the part where you set that part up. Thanks again for the extension, and the offer to help.
Cheers
One suggestion
I think it would be really helpful for the default action to be storing their choice and the grid in session so when they navigate away from the page and come back, their choice remains the same.
Thanks again for a really useful extension!
Make changes in Configuration file to access an extension
Please make following change in your configuration file:
From :-
'import'=>array(
'application.extensions.*',
'ext.LinkListPager.LinkListPager'
),
To :-
'import'=>array(
'application.extensions.*',
'application.extensions.AjaxList.AjaxList'
),
This extension is awesome.
Thanks.
Show All Records
I f you want display show all records without chaging in each admin or model file you can do with following code:
Write following code in extensions/AjaxList/AjaxList.php at starting of init() function.
$modelid = explode('-',$this->getOwner()->id); $model = null; for($i=0;$i<(count($im)-1);$i++) { $model .= ucfirst($im[$i]); } $newmodel=new $model('search'); $count = $newmodel->count(); $this->mPageSizeOptions[$count]='All';
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.