subhash
subhash

Reputation: 167

How to remove the pager for a CListView?

Hi here i am using CListView and i want to remove the pager header which is like this

[first] [previous] 1 2 3 4 [next] [last]

i want to remove all this the code here i am using is

$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
'enablePagination' => false ));

Upvotes: 1

Views: 2252

Answers (2)

Rogin Thomas
Rogin Thomas

Reputation: 772

PostController.php:

$dataProvider=new CActiveDataProvider('Post',
                    array(
                    'criteria'=>$criteria,
                    'pagination'=>array(
                                    'pageSize'=>1,
                            ),
                    )
            );

and this is view:

<?php $this->widget('zii.widgets.CListView', array(
    'dataProvider'=>$dataProvider,
    'itemView'=>'_view',
    'enableSorting'=>true,
    'template'=>"{items}\n{pager}", //this remove: Displaying #... of ... result
    'cssFile'=> Yii::app()->theme->baseUrl.'/style.css',
)); ?>

Upvotes: 0

Jon
Jon

Reputation: 437336

Set the template property to "{summary}\n{sorter}\n{items}", which differs from the default of "{summary}\n{sorter}\n{items}\n{pager}" in that it does not display the pager at all.

Upvotes: 1

Related Questions