文章分类 -  CGridView

摘要:常见用法:在CGridView中,使用CButtonColumn可以很方便地调用查看、更新、删除链接按钮: array( 'header'=>'操作', 'class'=>'CButtonColumn', 'headerHtmlOptions'=>array( 'width'=>'80', ), 'template'=>'{view} {update} {delete}', //默认显示的三个按钮,要去掉某个按钮,删除相应 阅读全文
posted @ 2013-04-14 10:14 IamCoder 阅读(185) 评论(0) 推荐(0)
摘要:Yii中的CGridView的大家用的都很爽,但是对于一些细节的使用方法可能还不是太清楚,今天准备使用CGridView实现批量操作的时候不知如何入手,然后一番百度谷歌。找到了自己想要的代码,分享一下。第一步:CGridView中的columns添加如下代码,作用是添加多选框。 array( 'selectableRows' => 2, 'footer' => '<button type="button" onclick="GetCheckbox();" style="width:76p 阅读全文
posted @ 2013-04-14 10:11 IamCoder 阅读(188) 评论(0) 推荐(0)
摘要:$this->widget(‘zii.widgets.grid.cgridview’, array( ‘dataprovider’ => $userdata, ‘columns’ => array( ‘id’, ‘username’, ‘fullname’, array( ‘datafield’ => ‘email’, ‘dataexpression’ => ‘chtml::mailto($data->email)’ ), ‘last_login’, array( ‘header’ => ‘操作’, ‘class’=>’CButtonColumn 阅读全文
posted @ 2013-04-14 10:09 IamCoder 阅读(107) 评论(0) 推荐(0)
摘要:CGridView 以表格的形式显示数据,CGridView 也支持分页和排序,CGridView最基本的用法和ListView类型,也是通过设置 data provider,通常是CActiveDataProvider。<?php $this->widget('zii.widgets.grid.CGridView', array('dataProvider'=>$dataProvider,'ajaxUpdate'=>false,'template'=>'{pager}{summary}{it 阅读全文
posted @ 2013-04-14 10:08 IamCoder 阅读(140) 评论(0) 推荐(0)