Код: Выделить всё
<?php $this->widget('bootstrap.widgets.TbGridView', array(
'type'=>'striped bordered condensed',
'id'=>'user-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
[
'class'=>'bootstrap.widgets.TbButtonColumn',
'template'=>'{update}{active}{inactive}',
//'deleteConfirmation'=>"js:'Выуверены, что хотите активировать данного ползователя?'",
'buttons'=> [
'active'=>[
'label'=>'Активировать',
'imageUrl'=>'/images/green-lock-icon.png',
'visible'=>'($data->status == 0? true : false)',
'options' => array(
'confirm' => 'Вы уверены, что хотите поменять статус пользователя?',
'ajax' => array(
'type' => 'post',
'url' => 'js:$(this).attr("href")',
'data'=> 'User[status] = 1',
'success' => 'js:function(data)
{
$.fn.yiiGridView.update("user-grid");
}'
),
//'id' => 'btn-act'.crc32(microtime()),
),
'url'=>'Yii::app()->controller->createUrl("active",array("id"=>$data->id))',
],
Подскажите совет как это сделать или другой способ. Спасибо!