neel
(Kazi Neel)
1
I have checkbox per row and want to update selected checkbox. Controller action is not working, can anyone help me.
Here is my view file
<?php $this->widget(‘zii.widgets.grid.CGridView’, array(
‘dataProvider’=>$dataProvider,
‘columns’=>array(
'id',
array(
'name'=>'Action', 'value'=>'CHtml::checkBox("cid[]",null,array("value"=>$data->id,"id"=>"cid_".$data->id))',
'type'=>'raw',
'htmlOptions'=>array('width'=>5),
//'visible'=>false,
),
'name',
'email',
),
)); ?>
nemo
(Nemoneel)
2
I am facing same problem. If anyone help that will be great.
vamp
(Vamphouse)
3
please, specify what do you mean, saying "update selected checkbox" - you need check/uncheck checkbox and you know it id?
There is a checkbox column type already existing:
CCheckBoxColumn
Theoretically this should fix your issue if implemented
Example usage in another forum post:
http://www.yiiframework.com/forum/index.php?/topic/7380-cgridview-selectablerows-quirk/
nemo
(Nemoneel)
5
Suppose I have 100 data and select 5 data using checkbox to assign to my User_id. Is that possible.
Here is my view file
<?php $this->widget(‘zii.widgets.grid.CGridView’, array(
‘dataProvider’=>$dataProvider,
‘columns’=>array(
‘id’,
array(
‘name’=>‘Action’,
‘value’=>‘CHtml::checkBox(“cid[]”,null,array(“update”,“value”=>$data->id,“id”=>“cid_”.$data->id))’,
,
‘type’=>‘raw’,
‘htmlOptions’=>array(‘width’=>5),
//‘visible’=>false,
),
‘item1’,
‘item2’,
),
)); ?>
I really appreciate if any one help me about controller action file.
nemo
(Nemoneel)
6
Can you help me with example? I really need that to implement my website.
Please refer to my previous post:
nemo
(Nemoneel)
8
Can you help me with example code?
I’ve not used it yet myself, but there is example code in the post that I linked to in my prior posts.
nemo
(Nemoneel)
10
Can you tell me how to create button or link for delete/update on the top?
<?php $this->widget(‘zii.widgets.grid.CGridView’, array(
'dataProvider'=>$dataProvider,
'showTableOnEmpty'=>false,
'selectableRows'=>2,
'emptyText'=>'Nowt to see.',
'columns'=>array(
array(
'class'=>'CCheckBoxColumn',
'name'=>'delete',
'value'=>'$data->id',
'id'=>'delete'
),
'name',
'loginName',
'password',
'email',
),
)); ?>