pagesize Widget for selecting Grid View page size

  1. Screen shot
  2. Requirements
  3. Usage

Simple widget for select Grid View page size

Screen shot

page size

Requirements

Yii 1.1 or above

Usage

// Extract and put PageSize folder into extensions directory
// Place the widget just before the GridView
<div align="right" class="row">
<?php 
$this->widget('application.extensions.PageSize.PageSize', array(
        'mGridId' => '<grid-id>', //Gridview id
	'mPageSize' => @$_GET['pageSize'],
        'mDefPageSize' => Yii::app()->params['defaultPageSize'],
        'mPageSizeOptions'=>Yii::app()->params['pageSizeOptions'],// Optional, you can use with the widget default
)); 
?>
</div>

// Add below to your model search()
'pagination' => array(	'pageSize'=>Yii::app()->user->getState('pageSize',Yii::app()->params['defaultPageSize']),
)

// Add below to your config/main.php params
'defaultPageSize' = 10,
'pageSizeOptions'=>array(10=>10,20=>20,50=>50,100=>100),


// Thats it.

Note: if you having issue with ajax submission fix this issue of framework

13 0
22 followers
1 813 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: User Interface
Developed by: Aruna Attanayake
Created on: Dec 7, 2011
Last updated: 12 years ago

Downloads

show all

Related Extensions