Submit CGridView Checked values using a form

后端 未结 3 1593
北海茫月
北海茫月 2021-01-20 08:09

I have a CGridView wigdet with CCheckBoxColumn like this:

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


        
3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-20 08:41

    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')"
    ));
    ?>
    

提交回复
热议问题