php – 如何在yii cgridview中使用x-editable启用或禁用可编辑选项?

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了php – 如何在yii cgridview中使用x-editable启用或禁用可编辑选项?脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我的cgridview是

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

我的问题是,当我检查启用的参数中的条件时,它根本不起作用.我不知道为什么?任何帮助将是欣赏.谢谢.

解决方法

x-editable似乎只有一个属性禁用,所以只需使用:)

http://x-editable.demopage.ru/index.php?r=site/widgets#Options

'name'=>'teamLeader_id','editable' => array(
                'type' => 'select','disabled' =>'$data->employeType == 1 ? true : false','success' => 'js: function(response) {
                    if(response.success == false){ 
                        console.log(response.message);
                        return response.message;
                    }
                }','options' => array(
                'ajaxOptions' => array('dataType' => 'json')
                ),)

脚本宝典总结

以上是脚本宝典为你收集整理的php – 如何在yii cgridview中使用x-editable启用或禁用可编辑选项?全部内容,希望文章能够帮你解决php – 如何在yii cgridview中使用x-editable启用或禁用可编辑选项?所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。