I have added check box to each row in cgridview, and a button Delete Selected to delete the selected rows,
now what i want to do is until a check box is checked, disable the Delete Selected button, how do i do this.?
Here is the code of my admin view:
<?php
$form = $this->beginWidget('CActiveForm', array(
'id' => 'account-form',
'action' => array('site/DeleteMultiple'),
'enableAjaxValidation' => true,
));
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'assign-grid',
'dataProvider'=>$model->search(),
'selectableRows' => 2,
'filter'=>$model,
'columns'=>array(
array(
'id' => 'id',
'class' => 'CCheckBoxColumn',
),
array(
'name'=>'username',
'value'=>'$data->user->username',
),
array(
'name'=>'Firstname',
'value'=>'$data->user->firstname',
),
array(
'class'=>'CButtonColumn',
),
),
)); ?>
<div id="submit-button" style="display:none">
<?php
echo CHtml::SubmitButton('Delete Selected', array('class' => 'button'));
?>
</div>
<?php $this->endWidget();?>