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

有帮助吗?

解决方案

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}',
                )
            );

其他提示

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;
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top