Submit CGridView Checked values using a form

后端 未结 3 1083
猫巷女王i
猫巷女王i 2021-01-20 08:03

I have a CGridView wigdet with CCheckBoxColumn like this:

$this->widget(\'zii.widgets.grid.CGridView\', array(
    \'dataProvider\'=>$dataProvider,
            


        
3条回答
  •  时光取名叫无心
    2021-01-20 08:28

    This one works with CSRF protection and updates the GridView.

    createUrl('controller/action'),
    array(
    'type'=>'POST',
    'data'=>'js:{"ids" : $.fn.yiiGridView.getChecked("grid_view_id","check_box_id").toString(),"YII_CSRF_TOKEN" : "'.Yii::app()->request->csrfToken.'"}',
    'success'=>"$('#grid_view_id').yiiGridView.update('grid_view_id')"
    ));
    ?>
    

提交回复
热议问题