Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update documentation for Livewire 3 dispatch #1700

Merged
merged 18 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `laravel-livewire-tables` will be documented in this file

## [v3.2.4] - 2024-03-01
### Bug Fixes
- Collapsing Columns fix when multiple tables are displayed on a page by @lrljoe

## [v3.2.3] - 2024-03-01
### New Features
- Add capability to customise colors/styling on the Pagination Per-Page Dropdown by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1677
Expand Down
12 changes: 6 additions & 6 deletions docs/datatable/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ These are the available events on the datatable component that you can fire from
### refreshDatatable

```php
$this->emit('refreshDatatable');
$this->dispatch('refreshDatatable');
```

Calls `$refresh` on the component. Good for updating from external sources or as an alternative to polling.
Expand All @@ -18,29 +18,29 @@ Calls `$refresh` on the component. Good for updating from external sources or as
You can have the table sort a specific column:

```php
$this->emit('setSort', 'name', 'asc');
$this->dispatch('setSort', 'name', 'asc');
```

### clearSorts

You can clear all the applied sorts:

```php
$this->emit('clearSorts');
$this->dispatch('clearSorts');
```

### setFilter

You can have the table run a specific filter:

```php
$this->emit('setFilter', 'status', '1');
$this->dispatch('setFilter', 'status', '1');
```

### clearFilters

You can have the table clear all filters:

```php
$this->emit('clearFilters');
```
$this->dispatch('clearFilters');
```
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<tr
x-data
@toggle-row-content.window="$event.detail.row === {{ $rowIndex }} ? $el.classList.toggle('{{ $component->isBootstrap() ? 'd-none' : 'hidden' }}') : null"
@toggle-row-content.window="($event.detail.tableName === '{{ $tableName }}' && $event.detail.row === {{ $rowIndex }}) ? $el.classList.toggle('{{ $component->isBootstrap() ? 'd-none' : 'hidden' }}') : null"

wire:key="{{ $tableName }}-row-{{ $row->{$this->getPrimaryKey()} }}-collapsed-contents"
wire:loading.class.delay="opacity-50 dark:bg-gray-900 dark:opacity-60"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@if (! $hidden)
<button
x-cloak x-show="!currentlyReorderingStatus"
x-on:click.prevent="$dispatch('toggle-row-content', {'row': {{ $rowIndex }}}); open = !open"
x-on:click.prevent="$dispatch('toggle-row-content', {'tableName': '{{ $tableName }}', 'row': {{ $rowIndex }}}); open = !open"
>
<x-heroicon-o-plus-circle x-cloak x-show="!open" class="text-green-600 h-6 w-6" />
<x-heroicon-o-minus-circle x-cloak x-show="open" class="text-yellow-600 h-6 w-6" />
Expand All @@ -36,7 +36,7 @@
@if (! $hidden)
<button
x-cloak x-show="!currentlyReorderingStatus"
x-on:click.prevent="$dispatch('toggle-row-content', {'row': {{ $rowIndex }}});open = !open"
x-on:click.prevent="$dispatch('toggle-row-content', {'tableName': '{{ $tableName }}', 'row': {{ $rowIndex }}});open = !open"
class="p-0"
style="background:none;border:none;"
>
Expand Down
2 changes: 1 addition & 1 deletion src/LaravelLivewireTablesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LaravelLivewireTablesServiceProvider extends ServiceProvider
public function boot(): void
{

AboutCommand::add('Rappasoft Laravel Livewire Tables', fn () => ['Version' => '3.2.3']);
AboutCommand::add('Rappasoft Laravel Livewire Tables', fn () => ['Version' => '3.2.4']);

$this->mergeConfigFrom(
__DIR__.'/../config/livewire-tables.php', 'livewire-tables'
Expand Down
Loading