Page Size Of Clistview

Hi all

Just want to clarify the following…

According to the CBasePager documentation, in order to set the page size of a CListView/ CGridView, you need to specify the pageSize property in the pager property of the CListView.




$this->widget('zii.widgets.CListView', array(

    'dataProvider'=>$dataProvider,

    'itemView'=>'_post',

    'sortableAttributes'=>array(

        'title',

    ),

    'enablePagination'=>true,

    'pager' => array(

        'class'=>'CLinkPager',

        'pageSize'=>2,

        )

));



However, this doesn’t seem to work. It seems that you need to set the page size inside the data provider instead of in the CListView.




$dataProvider->pagination->pageSize = 5;



I assumed the documentation is wrong or am I missing something?

The reason it does not work with CListView $dataProvider overrides the default properties of CListView.

But I didn’t specify pageSize in the dataProvider. Instead, I set it in the CListView. So shouldn’t the CListView’s pageSize be taken into consideration? Right now, it is acting as if I didn’t set any pageSize at all.

As I said dataProvider overrides the pageSize dataProvider has a default pageSize which take priority