Skip to content

Commit f8af259

Browse files
When there are no bulk actions, the checkboxes and the bulk action fu… (#12)
1 parent f72815d commit f8af259

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

resources/views/vendor/datatables/components/table.blade.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
<table class="w-full min-w-max divide-y divide-gray-200 border border-gray-300 rounded-lg shadow-sm hidden md:table">
33
<thead class="bg-gray-50">
44
<tr>
5+
@if (count($bulkActions) > 0)
56
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700 border">
67
<input type="checkbox" wire:click="toggleSelectAll"
78
class="h-5 w-5 text-blue-500 border-gray-300 rounded focus:ring-2 focus:ring-blue-400 transition">
89
</th>
10+
@endif
911
@foreach($columns as $column)
1012
@if(!in_array($column, $hiddenColumns))
1113
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700 border cursor-pointer hover:bg-gray-100 transition"
@@ -34,12 +36,14 @@ class="h-5 w-5 text-blue-500 border-gray-300 rounded focus:ring-2 focus:ring-blu
3436
@foreach($rows as $row)
3537
<tr class="hover:bg-gray-100 transition cursor-pointer"
3638
wire:click.prevent="toggleRowSelection({{ $row->id }})">
39+
@if (count($bulkActions) > 0)
3740
<td class="px-4 py-3 border">
3841
<input type="checkbox" wire:model="selectedRows"
3942
value="{{ $row->id }}"
4043
class="h-5 w-5 text-blue-500 border-gray-300 rounded focus:ring-2 focus:ring-blue-400 transition"
4144
onclick="event.stopPropagation();">
4245
</td>
46+
@endif
4347
@foreach($columns as $column)
4448
@if(!in_array($column, $hiddenColumns))
4549
<td class="px-4 py-3 border text-sm text-gray-700">

resources/views/vendor/datatables/datatable.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
@endif
2626
</div>
2727

28-
@if(count($selectedRows) > 0)
28+
@if(count($selectedRows) > 0 && count($bulkActions) > 0)
2929
<div class="flex items-center gap-2">
3030
@includeIf('datatable::components.bulk-action')
3131
</div>

0 commit comments

Comments
 (0)