CButtonColumn里的deleteButton显示控制问题? [ 新手入门 ]
我想控制CButtonColumn里的deleteButton显示与否,例如:
array(
'class' => 'CButtonColumn',
'template' => '{authId} {delete}',
'afterDelete' => 'function(link,success,data){ if(data) {alert(data);} }',
'buttons' => array(
'authId' => array(
'label' => '编辑权限',
'url' => 'Yii::app()->createUrl("auth/rightsManageme/distributionRights",
array("id"=>$data->primaryKey))',
'visible' => '$data->name != Yii::app()->params["adminRole"]',
'imageUrl' => Yii::app()->baseUrl."/images/share/icon_edit.gif",
),
),
),
相当于其他按钮的visible属性的运用,我自定义的按钮里面可以用‘visible’来控制此按钮是否显示,但是,在此组件自带的‘delete’按钮该怎么控制它的显示与否呢?
共 1 条回复
-
yhl27ml@163.com 回复于 2011-11-02 17:52 举报
呵呵,刚提交问题就马上想到了怎么解决了,不好意思。
就是重新写下‘delete’的visibel属性。。例如:array( 'class' => 'CButtonColumn', 'template' => '{authId} {delete}', 'afterDelete' => 'function(link,success,data){ if(data) {alert(data);} }', 'buttons' => array( 'authId' => array( 'label' => '编辑权限', 'url' => 'Yii::app()->createUrl("auth/rightsManagemen/distributionRights", array("id"=>$data->primaryKey))', 'visible' => '$data->name != Yii::app()->params["adminRole"]', 'imageUrl' => Yii::app()->baseUrl."/images/share/icon_edit.gif", ), 'delete' => array( 'visible' => '$data->name != Yii::app()->params["adminRole"]', ), ), ),
yhl27ml@163.com
注册时间:2011-04-09
最后登录:1970-01-01
在线时长:0小时0分
最后登录:1970-01-01
在线时长:0小时0分
- 粉丝0
- 金钱400
- 威望0
- 积分400