Код: Выделить всё
array(
'header'=>'selected',
'class'=>'CCheckBoxColumn',
'selectableRows'=>2,
'htmlOptions'=>array("width"=>"35"),
'checkBoxHtmlOptions'=>array(
'checked'=>'checked',
)),
Код: Выделить всё
<div id="allAction" class="allAdminAction2" title="Удалить выбранные записи" name="btndeleteall"> </div>
Код: Выделить всё
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
$('.search-form').toggle();
return false;
});
$('.search-form form').submit(function(){
$.fn.yiiGridView.update('sites-grid', {
data: $(this).serialize()
});
return false;
});
$('.allAdminAction2').click(function(){
var atLeastOneIsChecked = $('input[name=\"tableStyle_c0[]\"]:checked').length > 0;
if (!atLeastOneIsChecked)
{
alert('Please select atleast one record to delete');
}
else if (window.confirm('Are you sure you want to delete the the selected records?'))
{
document.getElementById('u2s-search-form').action='index.php?r=user2sites/deleteall';
document.getElementById('u2s-search-form').submit();
}
});
");