Php 如何在yii cgridview中使用x-editable启用或禁用可编辑选项?
我的观点是Php 如何在yii cgridview中使用x-editable启用或禁用可编辑选项?,php,yii,x-editable,cgridview,Php,Yii,X Editable,Cgridview,我的观点是 'name'=>'teamLeader_id', 'class' => 'bootstrap.widgets.TbEditableColumn', 'headerHtmlOptions' => array('style' => 'width:180px'), 'editable' => array(
'name'=>'teamLeader_id',
'class' => 'bootstrap.widgets.TbEditableColumn',
'headerHtmlOptions' => array('style' => 'width:180px'),
'editable' => array(
'type' => 'select',
'url' => Yii::app()->createUrl("employee/assignToTeamLeader"),
'source' => $usersList,
'enabled' =>'$data->employeType == 1 ? false : true',
'success' => 'js: function(response) {
if(response.success == false){
console.log(response.message);
return response.message;
}
}',
'options' => array(
'ajaxOptions' => array('dataType' => 'json')
),
)
我的问题是,当我在enabled param中检查条件时,它根本不起作用。我不知道为什么?任何帮助都将不胜感激。谢谢。x-editable似乎只有一个属性
disable
,所以只需使用它:)
你可以尝试使用
'apply' => '$data->employeType == 1 ? true : false',
我在这个页面上找到了这个,有可编辑的列文档。。。(请看源代码):
'apply' => '$data->employeType == 1 ? true : false',