Hi,
I want to show some data from a table in a grid with checkbox so that user can select check boxes and assign them to a person. It shows data but i want to assign checkbox id and i want to assign selected data on submit.
Here is my controller code:
public function actionList()
{
$model=new Tracking('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['Tracking']))
$model->attributes=$_GET['Tracking'];
$this->render('list',array(
'model'=>$model,
));
}
Here is my View Code:
List View
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'rider-drs-grid',
'dataProvider'=>$model->search(),
// 'filter'=>$model,
'columns'=>array(
// 'stopPublish'=>array('name'=>'stopPublish', 'type'=>'raw', 'value'=>'CHtml::checkBox("stopPublish",$data->stopPublish,array("id"=>"chkPublish_".$data->id))'),
'stopPublish'=>array('name'=>'stopPublish', 'type'=>'raw', 'value'=>'CHtml::checkBox("stopPublish","1",array("id"=>"chkPublish_2"))'),
'tracking_number',
'order_number',
'created',
'updated',
array(
'class'=>'CButtonColumn',
),
),
)); ?>