I need to get checked checkbox value from my view to controller when button is press.
Gridview :
<div class="installment-ready">
<!-- <h1><?= Html::encode($this->title) ?></h1> -->
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
//'filterModel' => $searchModel,
'columns' => [
[
'class' => 'yii\grid\SerialColumn',
'contentOptions'=>[ 'style'=>'width: 60px'],
],
//Checkbox
[
'class' => 'yii\grid\CheckboxColumn',
'contentOptions'=>[ 'style'=>'width: 50px'],
'name' => 'checked',
'checkboxOptions'=> function($model, $key, $index, $column) {
return ["value" => $model->ACCOUNT_ID];
}
],
Button to process selected checkbox:
<?= Html::a('Submit', ['#'], ['class' => 'btn btn-success pull-right']) ?>
Yii::$app->request->post().