dimanche 7 mai 2017

Yii2 Grdiview Checkbox column submit via Form

in my yii2 project i've got a gridview with a simple checkbox column.

<?= 
GridView::widget([
    'id' => 'gridwithcheckboxes',
    'dataProvider' => $dataProvider,
    'columns' => [
        ['attribute' => 'a', 'value' => 'tabfora.a'],
        ['attribute' => 'b', 'value' => 'tabforb.b'],
        'user',
        'mobile',
        'description',
        ['class' => 'yii\grid\CheckboxColumn'],
    ],
]);

?>

I know i can get the checkboxes values by this js helper:

var keys = $('#gridwithcheckboxes').yiiGridView('getSelectedRows');

Is there a method to pass them with a form submit to a controller action instead using javascript?

Thanks for all the help.




Aucun commentaire:

Enregistrer un commentaire