When i use the below code it overrides the action-column delete/update links.
\'rowOptions\' => function ($model, $key, $index, $grid) {
return [
Nothing worked for me from these solutions except:
echo GridView::widget([
...
'rowOptions' => function ($model, $key, $index, $grid) {
return [
'style' => "cursor: pointer",
'myurl' => ['/route','id'=>$model->id],
];
}
...
And the Javascript piece:
$this->registerJs("
$('tbody tr[myurl]').click(function (e) {
if ($(e.target).is('td')) {
window.location.href = $(this).attr('myurl');
}
});
");
Don't now why the other solutions did not work but maybe this solution helps someone before wasting time for hours - as in my case :-(