开发者

How to customize Yii CGridView Pager?

How to customize Yii CGridView Pag开发者_C百科er about its position, css, template?


You can custumize via 'pager' CGridView properties. Example:

$this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'My-grid',
    'dataProvider'=>$dataProvider,
    'pager'=>array(
        'header'         => '',
        'firstPageLabel' => '<<',
        'prevPageLabel'  => '<img src="images/pagination/left.png">',
        'nextPageLabel'  => '<img src="images/pagination/right.png">',
        'lastPageLabel'  => '&gt;&gt;',
    ),
    'template'=>'{pager}{items}{pager}',
    'columns'=>$arrayColumns,
));


  1. http://www.yiiframework.com/doc/api/CBaseListView#pager-detail
  2. http://www.yiiframework.com/doc/api/CBaseListView#pagerCssClass-detail
  3. http://www.yiiframework.com/doc/api/CLinkPager


Here's another approach which worked for me.

Displaying Yii's CLinkPager "First" and "Last" Buttons

If you have troubles, make sure to read the comments below the entry.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜