Код: Выделить всё
<?=GridView::widget([
'id' => 'disallowList',
'dataProvider' => new ArrayDataProvider([
'allModels' => Method::find()->select(['name','id'])->asArray()->all(),
'pagination' => [
'pageSize' => false,
],
]),
'columns' => [
[
'class' => 'yii\grid\CheckboxColumn',
'content' => function($row) use ($form, $disallowForm){
return $form->field($disallowForm, 'disallow['.$row['id'].'][disable]')->checkbox(['label' => false]);
}
],[
'attribute' => 'name',
]
],
'summary' => false
])?>
Код: Выделить всё
var keys = $('#disallowList').yiiGridView('getSelectedRows');
console.log(keys)