Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在yii cgridview中使用x-editable启用或禁用可编辑选项?_Php_Yii_X Editable_Cgridview - Fatal编程技术网

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',