视图文件调用cgridview,clistview时候调用自定义的分页方法- <?php $this->widget('zii.widgets.grid.CGridView', array(
- 'id'=>'news-grid',
- 'dataProvider'=>$model->search(),
- 'filter'=>$model,
- 'template'=>'{items}{summary}{pager}',
- 'selectableRows'=>2,
- 'pager'=>'ZPager',
- 'summaryText'=>'页数:{pages}/{page}页',
- 'columns'=>array(
- array(
- 'class'=>'CCheckBoxColumn',
- 'footer'=>'<button onclink="deleteAll()">button</button>
- <button onclink="refashAll()">button</button>',
- 'footerHtmlOptions'=>array('colspan'=>5),
- 'selectableRows'=>2,
- ),
- 'id',
- array('name'=>'title',
- 'htmlOptions'=>array('width'=>'20%'),
- 'value'=>'mb_substr($data->title,0,10,"utf-8")',
- ),
- array('name'=>'content',
- 'htmlOptions'=>array('width'=>'20%'),
- 'value'=>'mb_substr(strip_tags($data->content),0,10,"utf-8")',
- ),
- array('name'=>'type',
- 'value'=>'News::model()->getNewsType($data->type)',
- ),
- 'user',
- array('name'=>'status',
- 'value'=>'News::model()->getNewsStatus($data->status)',
- ),
- array(
- 'class'=>'CButtonColumn',
- 'buttons'=>array(
- 'view'=>array('visible'=>'false'),
- //'delete'=>array('click'=>'true'),
- ),
- ),
- ),
- ));