Skip to content

Commit

Permalink
Fixes for AlpineJS - Select All & Deselect All (#1209)
Browse files Browse the repository at this point in the history
  • Loading branch information
lrljoe committed May 18, 2023
1 parent e46ad47 commit 0f1f196
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
14 changes: 7 additions & 7 deletions resources/views/components/table/tr/bulk-actions.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class="bg-indigo-50 dark:bg-gray-900 dark:text-white"
</span>

<button
wire:click="clearSelected"
x-on:click="clearSelected"
wire:loading.attr="disabled"
type="button"
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400"
Expand Down Expand Up @@ -55,7 +55,7 @@ class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium
</button>&nbsp;

<button
wire:click="setAllSelected"
x-on:click="setAllSelected"
wire:loading.attr="disabled"
type="button"
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400"
Expand All @@ -64,7 +64,7 @@ class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium
</button>

<button
wire:click="clearSelected"
x-on:click="clearSelected"
wire:loading.attr="disabled"
type="button"
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400"
Expand All @@ -90,7 +90,7 @@ class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium
</span>

<button
wire:click="clearSelected"
x-on:click="clearSelected"
wire:loading.attr="disabled"
type="button"
class="btn btn-primary btn-sm"
Expand All @@ -109,7 +109,7 @@ class="btn btn-primary btn-sm"
</span>

<button
x-on:click="selectAllOnPage()"
x-on:click="selectAllOnPage"
wire:loading.attr="disabled"
type="button"
class="btn btn-primary btn-sm"
Expand All @@ -118,7 +118,7 @@ class="btn btn-primary btn-sm"
</button>&nbsp;

<button
wire:click="setAllSelected"
x-on:click="setAllSelected"
wire:loading.attr="disabled"
type="button"
class="btn btn-primary btn-sm"
Expand All @@ -127,7 +127,7 @@ class="btn btn-primary btn-sm"
</button>

<button
wire:click="clearSelected"
x-on:click="clearSelected"
wire:loading.attr="disabled"
type="button"
class="btn btn-primary btn-sm"
Expand Down
6 changes: 6 additions & 0 deletions resources/views/components/wrapper.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
selectedCount: 0,
visibleItems: {},
allItemsSelected: false,
setAllSelected() {
$wire.setAllSelected();
},
clearSelected() {
$wire.clearSelected();
},
selectAllOnPage() {
let tempSelectedItems = this.selectedItems;
const iterator = visibleItems.values();
Expand Down

0 comments on commit 0f1f196

Please sign in to comment.