You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## [v3.4.2] - 2024-08-04
### New Features
- Additional Events & Customisable Behaviour by @lrljoe in rappasoft#1820
### Bug Fixes
- Typehinting to allow events to be used to update Multi-Value Filters by @lrljoe in rappasoft#1822
### Tweaks
- Add missing ReturnTypes by @lrljoe in rappasoft#1823
- Removing old $listeners approach, now using the Livewire v3 On attribute by @lrljoe in rappasoft#1821
---------
Co-authored-by: lrljoe <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,17 @@
2
2
3
3
All notable changes to `laravel-livewire-tables` will be documented in this file
4
4
5
+
## [v3.4.2] - 2024-08-04
6
+
### New Features
7
+
- Additional Events & Customisable Behaviour by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1820
8
+
9
+
### Bug Fixes
10
+
- Typehinting to allow events to be used to update Multi-Value Filters by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1822
11
+
12
+
### Tweaks
13
+
- Add missing ReturnTypes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1823
14
+
- Removing old $listeners approach, now using the Livewire v3 On attribute by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1821
15
+
5
16
## [v3.4.1] - 2024-08-04
6
17
### Bug Fixes
7
18
- Fix ViewComponentColumn issue with not accepting parameters cleanly by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1818
Copy file name to clipboardExpand all lines: docs/datatable/events.md
+106-6Lines changed: 106 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,44 +3,144 @@ title: Events
3
3
weight: 2
4
4
---
5
5
6
-
These are the available events on the datatable component that you can fire from your application:
6
+
### Listened For
7
+
These are the available events on the datatable component that you can fire from your application, or client-side
7
8
8
-
### refreshDatatable
9
+
####refreshDatatable
9
10
10
11
```php
11
12
$this->dispatch('refreshDatatable');
12
13
```
13
14
14
15
Calls `$refresh` on the component. Good for updating from external sources or as an alternative to polling.
15
16
16
-
### setSort
17
+
####setSort
17
18
18
19
You can have the table sort a specific column:
19
20
20
21
```php
21
22
$this->dispatch('setSort', 'name', 'asc');
22
23
```
23
24
24
-
### clearSorts
25
+
####clearSorts
25
26
26
27
You can clear all the applied sorts:
27
28
28
29
```php
29
30
$this->dispatch('clearSorts');
30
31
```
31
32
32
-
### setFilter
33
+
####setFilter
33
34
34
35
You can have the table run a specific filter:
35
36
36
37
```php
37
38
$this->dispatch('setFilter', 'status', '1');
38
39
```
39
40
40
-
### clearFilters
41
+
####clearFilters
41
42
42
43
You can have the table clear all filters:
43
44
44
45
```php
45
46
$this->dispatch('clearFilters');
46
47
```
48
+
49
+
### Dispatched
50
+
51
+
There are several events, all in the Rappasoft\LaravelLivewireTables\Events namespace
52
+
| Event Name | Event Purpose | Data Passed |
53
+
| --- | --- | --- |
54
+
| ColumnsSelected | Applied whenever a Column is selected/deselected from view | The Table Name ($tableName), Selected Columns ($value), Logged In User ($user) |
55
+
| FilterApplied | Applied when a Filter is applied (not when removed) | The Table Name ($tableName), Filter Key ($key), Filter Value ($value), Logged In User ($user) |
56
+
| SearchApplied | Applied when a Search is applied (not when removed) | The Table Name ($tableName), Search Term ($value), Logged In User ($user) |
57
+
58
+
By default, the Tables will dispatch an event when the Selected Columns is changed, you may customise this behaviour:
59
+
60
+
#### enableAllEvents
61
+
62
+
This enables all Dispatched Events. This should be used with caution, as more events will be introduced in the future.
63
+
64
+
```php
65
+
public function configure(): void
66
+
{
67
+
$this->enableAllEvents();
68
+
}
69
+
```
70
+
71
+
#### disableAllEvents
72
+
73
+
This disables all Dispatched Events.
74
+
75
+
```php
76
+
public function configure(): void
77
+
{
78
+
$this->disableAllEvents();
79
+
}
80
+
```
81
+
82
+
#### enableColumnSelectEvent
83
+
84
+
Enables the Column Select Event, has no impact on other events
85
+
86
+
```php
87
+
public function configure(): void
88
+
{
89
+
$this->enableColumnSelectEvent();
90
+
}
91
+
```
92
+
93
+
#### disableColumnSelectEvent
94
+
95
+
Disables the Column Select Event, has no impact on other events
96
+
97
+
```php
98
+
public function configure(): void
99
+
{
100
+
$this->disableColumnSelectEvent();
101
+
}
102
+
```
103
+
104
+
#### enableSearchAppliedEvent
105
+
106
+
Enables the Search Applied Event, has no impact on other events
107
+
108
+
```php
109
+
public function configure(): void
110
+
{
111
+
$this->enableSearchAppliedEvent();
112
+
}
113
+
```
114
+
115
+
#### disableSearchAppliedEvent
116
+
117
+
Disables the Search Applied Event, has no impact on other events
118
+
119
+
```php
120
+
public function configure(): void
121
+
{
122
+
$this->disableSearchAppliedEvent();
123
+
}
124
+
```
125
+
126
+
#### enableFilterAppliedEvent
127
+
128
+
Enables the Filter Applied Event, has no impact on other events
129
+
130
+
```php
131
+
public function configure(): void
132
+
{
133
+
$this->enableFilterAppliedEvent();
134
+
}
135
+
```
136
+
137
+
#### disableFilterAppliedEvent
138
+
139
+
Disables the Filter Applied Event, has no impact on other events
0 commit comments