When i use the below code it overrides the action-column delete/update links.
\'rowOptions\' => function ($model, $key, $index, $grid) {
return [
Use : rowOptions
=
GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'layout' => "{summary}\n{items}\n{pager}",
'rowOptions' => function ($model, $key, $index, $grid) {
return ['data-id' => $model->id];
},
'columns' => [
['class' => 'yii\grid\SerialColumn', 'contentOptions' => ['width' => '']],
'name',
'email',
[
'class' => 'yii\grid\ActionColumn',
'contentOptions' => ['class' => 'disable-click'],
'header' => "Actions",
'template' => '{update} {delete}',
],
],
]);
?>
registerJs("
$('tbody td:not(.disable-click)').css('cursor', 'pointer');
$(document).on('click','table tr td:not(.disable-click)',function(e) {
var id = $(this).closest('tr').data('id');
if (e.target == this && id)
location.href = '" . Url::to(['/contacts/view']) . "?id=' + id;
});
");
?>