I have a CGridView with two checkbox columns. I am able to display the grid with the multiple checkboxes per row, and with preset checked values based on data in the database.
My Question: how can I send data to my controller containing information about each rows checked state, for each column containing a checkbox?
The checkbox columns are used to indicate if a client has received a particular type of service. I have created the grid with the following code:
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'service-grid',
'dataProvider'=>$clients->search(),
'columns'=>array(
'first_name',
'last_name',
array(
'header'=>'Education',
'class'=>'CDataColumn',
'type'=>'raw',
'htmlOptions'=>array('style'=>'text-align:center'),
'value' => 'CHtml::checkBox("esid[]", $data->education, array("value"=>$data->wc_client_id,"id"=>"esid_".$data->wc_client_id))',
),
array(
'header'=>'Health',
'class'=>'CDataColumn',
'type'=>'raw',
'htmlOptions'=>array('style'=>'text-align:center'),
'value' => 'CHtml::checkBox("hsid[]", $data->health, array("value"=>$data->wc_client_id,"id"=>"hsid_".$data->wc_client_id))',
)
),
));