darecki, on 26 October 2010 - 03:56 PM, said:
That's all true and I both know and understand it. But it's very strange for me that we can change other global parameters, like for example:
'widgetFactory' => array(
'widgets' => array(
'CLinkPager' => array(
'maxButtonCount' => 15,
),
),
), in the mentioned config/main.php file, but we can't do it with the page size this way.
I extended CGridView and overrode init() like this
<?php
Yii::import('zii.widgets.grid.CGridView');
class MyExtGridView extends CGridView
{
public function init()
{
if($this->dataProvider!==null)
$this->dataProvider->pagination->pageSize = $this->pager[pageSize];
parent::init();
}
}
Now you can use
'widgetFactory'=>array(
'class'=>'CWidgetFactory',
'widgets' => array(
'MyExtGridView' => array(
'pager' => array(
'pageSize' => 50,
),
),
),
),
(no promise this will work in all cases)
/Tommy
This post has been edited by tri: 26 October 2010 - 07:16 PM