Yii框架引导程序 - 获取TbEditableColumn启用属性以使用表达式而不是布尔值

时间:2013-03-06 20:59:55

标签: twitter-bootstrap yii

有没有办法让TbEditableColumn enabled属性使用表达式而不是布尔值(即:true)

以下是我想要做的一个例子:

array(
  'class' => 'bootstrap.widgets.TbEditableColumn',
  'name' => 'description',

  'editable' => array(
       'type' => 'textarea',
   'url' => $this->createUrl('classification/update'),
   'placement' => 'top',
       'enabled' => '($data->status > 0) ? true : false;',
  )
),

应该注意的是,这适用于使用bootstrap.widgets.TbButtonColumn时可用的可见属性,如下所示:

array(
'class' => 'bootstrap.widgets.TbButtonColumn',
'deleteConfirmation' => 'Are you sure you wish to delete this classification?',
'template' => '{delete}',

'buttons'=>array(
    'delete' => array(
    'visible' => '($data->status > 0) ? true : false;',
)
), 

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

确保您没有设置列的“值” - 请阅读代码here: 您是否尝试使用'apply'=> true?

,而不是启用