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' => '>>',
),
'template'=>'{pager}{items}{pager}',
'columns'=>$arrayColumns,
));
- http://www.yiiframework.com/doc/api/CBaseListView#pager-detail
- http://www.yiiframework.com/doc/api/CBaseListView#pagerCssClass-detail
- 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.
精彩评论