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


Yii 1.1 or above


// Extract and put PageSize folder into extensions directory
// Place the widget just before the GridView
<div align="right" class="row">
$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

// 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,

// Thats it.

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

13 0
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: 11 years ago


show all

Related Extensions