Yii Framework Forum: pageSize doesn't work with cListView - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

pageSize doesn't work with cListView Rate Topic: -----

#1 User is offline   jabbon 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 13-April 11

Posted 13 April 2011 - 11:28 AM

Hi im new to yii and im trying to display a list of items with "cListView" widget, but when i try to change the default value of "pageSize" i dont't see te change. it always displays 10 items. Can anyone helme? Thanks.

$this->widget('zii.widgets.CListView', array(
        'dataProvider'=>$model->search(),
        'itemView'=>'_view',  
        'pager'=>array(
            'class'=>'CLinkPager',
            'header'=>'Ir a la página',
            'pageSize'=>12, 
            'firstPageLabel'=>'<<primero',
            'prevPageLabel'=>'< anterior',
            'nextPageLabel'=>'siguiente >',	
            'lastPageLabel'=>'último >>',     
        )
    ));


And i have this relations in my model

public function relations()
	{
            return array(
                'fotos' => array(self::HAS_MANY, 'Fotos', 'idmascota'),
                'subcategoria' => array(self::BELONGS_TO, 'Subcategoria', 'idsubcategoria'),
                'categoria' => array(self::BELONGS_TO, 'Categoria', 'idcategoria'),
                'user' => array(self::BELONGS_TO, 'User', 'iduser'),
            );
	}

0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,528
  • Joined: 12-October 09
  • Location:Croatia

Posted 13 April 2011 - 04:18 PM

Set the pageSize in CActiveDataProvider::pagination property - http://www.yiiframew...gination-detail
Find more about me.... btw. Do you know your WAN IP?
0

#3 User is offline   jabbon 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 13-April 11

Posted 13 April 2011 - 04:32 PM

Thanks works fine!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users