{pager} and {summary} at same line?

Hi everybody,

i’m using template property of CGridView in this way: ‘template’=>"{pager}{summary}{items}{summary}{pager}",

The question: is it possible to have {pager} and {summary} at same line or row(on top and footer)? because otherway i think that much wasted space in page (mainly on top).

Thanks a lot!!!

An easy solution is to override the styles of the pager and the summary divisions.

Try adding it to your view:




Yii::app()->getClientScript()->registerCss(

    'modify-gridview-style',

    ".grid-view .summary { float: left; }\n.grid-view .pager { float: left; }"

);



Hi softark,

fantastic, i’ve have to adjust some more css properties but it’s a easy and fast solution.

Best regards!!!

And if you want the alternative style globally, you can replace the whole css file in the application config using the widget factory properties:




// application components

'components' => array(

    ...

    'widgetFactory' => array(

        'widgets' => array(

            ...

            'CGridView' => array(

                'template' => '{summary}{pager}{items}{pager}',

                'cssFile' => '/css/gridview/style.css',

            ),

            ...



In the above, I’m using my own css file for CGridView … it’s a slightly modified copy of the original css file that you can find in \framework\zii\widgets\assets\gridview

http://www.yiiframework.com/doc/api/1.1/CWidgetFactory