git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_IntranetNueva/trunk@73 77cfc57b-8ef4-1849-9df6-4a38aa5da120
29 lines
850 B
PHP
29 lines
850 B
PHP
<?php
|
|
/**
|
|
* Simple widjet for selecting page size of gridviews
|
|
*
|
|
* @author Aruna Attanayake <aruna470@gmail.com>
|
|
* @version 1.0
|
|
*/
|
|
|
|
class PageSize extends CWidget
|
|
{
|
|
public $mPageSizeOptions = array(10=>10, 25=>25, 50=>50, 75=>75, 100=>100);
|
|
public $mPageSize = 10;
|
|
public $mGridId = '';
|
|
public $mDefPageSize = 10;
|
|
|
|
public function run()
|
|
{
|
|
Yii::app()->user->setState('pageSize', $this->mPageSize);
|
|
|
|
$this->mPageSize = null == $this->mPageSize ? $this->mDefPageSize : $this->mPageSize;
|
|
|
|
echo Yii::t('pagesize', 'Mostrar ');
|
|
echo CHtml::dropDownList('pageSize', $this->mPageSize, $this->mPageSizeOptions, array(
|
|
'onchange'=>"jQuery.fn.yiiGridView.update('$this->mGridId',{ data:{pageSize: jQuery(this).val() }})",
|
|
));
|
|
echo Yii::t('pagesize', ' registros');
|
|
}
|
|
}
|
|
?>
|