ersks
ersks

Reputation: 1499

Yii: Show more than 10 rows in TbGridView

I want to show rows in descending order in Manage page, so what should I do for displaying more than 10 rows in *.widgets.TbGridView? Any Help?

Upvotes: 1

Views: 282

Answers (2)

ersks
ersks

Reputation: 1499

Displaying 30 rows in pagination

return new CActiveDataProvider($this, array(
    'pagination' => array(
        'pageSize' => 30,
    ),
    'criteria' => $criteria,
));

Display Initial rows in descending order

$criteria->order = "t.id DESC";

Upvotes: 0

hamed
hamed

Reputation: 8033

You pass CActiveDataProvider to CGridView or TbGridView in the manage action. All you need to do is passing the page size to dataprovider:

return new CActiveDataProvider($this, array(
        'pagination' => array(
            'pageSize' => 20,
        ),

        'criteria' => $criteria,
    ));

Upvotes: 1

Related Questions