ashaheen
(Amir Shaheen)
August 7, 2012, 6:06am
1
<?php
$this->widget(‘zii.widgets.grid.CGridView’, array(
'id'=>'user-grid',
'dataProvider'=>$pMethods,
'columns'=>array(
array(
'name'=>'ID',
'value' => 'CHtml::checkBox("paymentMethods[]",false,array("value"=>$data["id"]))',
'type'=>'raw',
),
'type',
'description',
)
));
?>
same code used for add/edit the payment methods, problem is how to checked the checkbox in edit mode that user added previously mean to say how marked a checkbox dynamically.
h3rm
August 7, 2012, 6:14am
2
why not use CCheckBoxColumn
http://www.yiiframework.com/doc/api/1.1/CCheckBoxColumn/
it will be:
<?php
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'user-grid',
'dataProvider'=>$pMethods,
'columns'=>array(
array(
'name' =>'ID',
'class' => 'CCheckBoxColumn',
'checked' => '$data["id"]',
'selectableRows'=>2, // multiple selected row
),
'type',
'description',
)
));
?>
ashaheen
(Amir Shaheen)
August 7, 2012, 6:25am
3
how can we apply loop on added values to check which box is going to ON??