Update selected checkbox
#1
Posted 02 March 2010 - 10:59 AM
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',
),
)); ?>
#3
Posted 03 March 2010 - 09:59 AM
-Thanks, you make me stronger!
#4
Posted 03 March 2010 - 10:01 AM
CCheckBoxColumn
Theoretically this should fix your issue if implemented :-)
Example usage in another forum post:
http://www.yiiframew...ablerows-quirk/
#5
Posted 03 March 2010 - 10:09 AM
vamp, on 03 March 2010 - 09:59 AM, said:
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.
#6
Posted 06 March 2010 - 07:53 PM
intel352, on 03 March 2010 - 10:01 AM, said:
CCheckBoxColumn
Theoretically this should fix your issue if implemented :-)
Example usage in another forum post:
http://www.yiiframew...ablerows-quirk/
Can you help me with example? I really need that to implement my website.
#7
Posted 08 March 2010 - 05:30 PM
nemo, on 06 March 2010 - 07:53 PM, said:
Please refer to my previous post:
intel352, on 03 March 2010 - 10:01 AM, said:
CCheckBoxColumn
Example usage in another forum post:
http://www.yiiframew...ablerows-quirk/
#9
Posted 08 March 2010 - 05:58 PM
nemo, on 08 March 2010 - 05:49 PM, said:
I've not used it yet myself, but there is example code in the post that I linked to in my prior posts.
#10
Posted 08 March 2010 - 06:13 PM
intel352, on 08 March 2010 - 05:58 PM, said:
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',
),
)); ?>

Help












