Skip to content
This repository was archived by the owner on Oct 20, 2025. It is now read-only.

Commit 178816f

Browse files
[FIX BUG]309: splade checkbox datatable with row link when click checkbox keep redirect to row link (#310)
Co-authored-by: Pascal Baljet <pascal@protone.media>
1 parent 0d33df9 commit 178816f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

resources/views/table/body.blade.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
@php $itemPrimaryKey = $table->findPrimaryKey($item) @endphp
44

55
<tr
6-
@if($table->rowLinks->has($itemKey))
7-
class="cursor-pointer"
8-
@click="(event) => table.visit(@js($table->rowLinks->get($itemKey)), @js($table->rowLinkType), event)"
9-
@endif
106
:class="{
117
'bg-gray-50': table.striped && @js($itemKey) % 2,
128
'hover:bg-gray-100': table.striped,
@@ -29,8 +25,11 @@ class="rounded border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-300
2925

3026
@foreach($table->columns() as $column)
3127
<td
28+
@if($table->rowLinks->has($itemKey))
29+
@click="(event) => table.visit(@js($table->rowLinks->get($itemKey)), @js($table->rowLinkType), event)"
30+
@endif
3231
v-show="table.columnIsVisible(@js($column->key))"
33-
class="whitespace-nowrap text-sm @if($loop->first && $hasBulkActions) pr-6 @else px-6 @endif py-4 @if($column->highlight) text-gray-900 font-medium @else text-gray-500 @endif"
32+
class="whitespace-nowrap text-sm @if($loop->first && $hasBulkActions) pr-6 @else px-6 @endif py-4 @if($column->highlight) text-gray-900 font-medium @else text-gray-500 @endif @if($table->rowLinks->has($itemKey)) cursor-pointer @endif"
3433
>
3534
@isset(${'spladeTableCell' . $column->keyHash()})
3635
{{ ${'spladeTableCell' . $column->keyHash()}($item, $itemKey) }}

0 commit comments

Comments
 (0)