Question

I use CGridView in Yii to create tables.

I would like to show my table with pagination but hide the summary text at the top, which indicates the number of page restance (Displaying 1-4 of 4 results.)

Is that possible? thank you

Sorry for my English

Était-ce utile?

La solution

There is a template option. By default it equals {summary}\n{items}\n{pager}

If you override it in your gridview config, you'l be able to remove summary section:

$this->widget(
                'zii.widgets.CGridView',
                array(
                    Your options here ...
                    'template' => '{items}\n{pager}',
                )
            );

Autres conseils

Another option is to set the CGridView summaryText value to false

Because YII uses CListView, it also add a certain summary class CSS in the asset folder. So to combat this, simply override the css.

Add this to your CSS.

#yw0>.summary{ 
    display:none;
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top