Yii 1.1: listpagerajax

cListPager With Ajax Update
12 followers

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:- AjaxListPager

This what we need to do to.

Let me know for any modifications....

Total 6 comments

#11500 report it
hiral darji at 2013/01/17 01:51am
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';
#9319 report it
karmraj at 2012/08/03 04:40am
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.

#8057 report it
deez at 2012/05/07 12:37pm
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!

#7973 report it
deez at 2012/04/30 09:39am
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

#7953 report it
Shiva Prasad (KTree ) at 2012/04/28 05:15am
Show all

Yeah we can make that... I will provide upgrade version..

#7905 report it
deez at 2012/04/25 12:53pm
Great extension

I really like this extension, is there any way to make a "show all" button easily?

Leave a comment

Please to leave your comment.

Create extension
Downloads