TbGridView have a column that has a checkbox and a button to remove the selected. Made in a grid functioned normally, I went to the other grid and takes no further action. The button is as if no action. Follows the code. thank you
Botão
<?php
echo CHtml::htmlButton('Remover Selecionado(s)', array(
'type' => 'button',
'ajax' => array(
'type' => 'POST',
'url' => Yii::app()->createUrl('admin/photos/delete'),
'dataType' => 'json',
'beforeSend' => 'function(){
var id = $.fn.yiiGridView.getSelection(\'admin-grid-photos\');
if(id == \'\'){
alert(\'Selecione pelo menos 1 item\');
return false;
}
if(!confirm(\'' . Yii::t('zii', 'Você tem certeza que deseja excluir?') . '\')) return false;
}',
'success' => "function(data){\$.fn.yiiGridView.update('admin-grid-photos');}",
'data' => "js:{ids:$.fn.yiiGridView.getSelection('admin-grid-photos')}"
)
));
?>
Grid
<?php
$this->widget('bootstrap.widgets.TbGridView', array(
'type' => 'condensed striped',
'id' => 'admin-grid-photos',
'dataProvider' => $provider,
'columns' => array(
array(
'class' => 'CCheckBoxColumn',
),
array(
'type' => 'html',
'name' => 'Imagem',
'value' => 'CHtml::image($data->thumbnail_url, "", array("width"=>125))',
),
array(
'name' => 'Data cadastro',
'value' => 'Yii::app()->dateFormatter->formatDateTime($data->cadastro, "medium", null)'
)
),
));
?>