OKyJIucT
4/21/2017 - 1:18 PM

row options

row options

<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'rowOptions' => function ($model, $key, $index, $grid) {

        $class = 'key_id_' . $model->id;

        return [
            'key' => $key,
            'index' => $index,
            'class' => $class
        ];
    },
    'columns' => [
        ['class' => 'yii\grid\CheckboxColumn'],

        'name',
    ],
    'options' => [
        'class' => 'grid'
    ],
    'tableOptions' => [
        'class' => 'table table-bordered',
    ],
]); ?>