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.0] - 2024-08-04
### New Features
- Add Helpers for TextFilters by @lrljoe in #1812
- Change method names for TextFilters handler by @lrljoe in #1814
- Capability to set Reorder Column TH Attributes by @lrljoe in #1811
- Bulk Actions - Customise Select All Behaviours by @lrljoe in #1810
### Bug Fixes
- Fix loading spinner for dark tailwind theme by @lrljoe in #1809
### Tweaks
- Blade Minimisation & ColumnSelect Cleanup by @lrljoe in #1806
- Adjust DateColumn with Missing Tests and Coping with DateTime Casts by @lrljoe in #1813
### Docs
- Add reference to Bulk Actions TH styling in main styling by @lrljoe in #1808
- Update docs for setPillsLocale by @lrljoe in #1800
- Add note on label method for setAdditionalSelects by @lrljoe in #1816
Copy file name to clipboardExpand all lines: docs/bulk-actions/available-methods.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -290,4 +290,26 @@ public function configure(): void
290
290
{
291
291
$this->setClearSelectedOnFilterDisabled();
292
292
}
293
-
```
293
+
```
294
+
295
+
## setDelaySelectAllEnabled
296
+
297
+
By default, using the "Select All", immediately makes a call to the backend to populate the "selected" array with the primary key of all resultant rows (based on Filter/Search). This can be slow with large result sets, but gives a good user experience with smaller results, as it allows them to "Select All" and then deselect some rows.
298
+
299
+
```php
300
+
public function configure(): void
301
+
{
302
+
$this->setDelaySelectAllEnabled();
303
+
}
304
+
```
305
+
306
+
This prevents the default behaviour from firing, which improves performance when working with very large sets of data. With this feature enabled, the backend update will not fire, however an indication that all result rows have been selected will be passed to the backend, and the frontend will behave as if all rows are selected.
307
+
308
+
When running your Bulk Action, having used "Select All", you may then access the array of "all rows" based on your most recent search/filter results:
309
+
```
310
+
$rows = $this->getSelectedRows();
311
+
```
312
+
313
+
## setDelaySelectAllDisabled
314
+
315
+
This is the default behaviour, see setDelaySelectEnabled for details on what enabling this does.
Copy file name to clipboardExpand all lines: docs/columns/available-methods.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,10 @@ title: Available Methods
3
3
weight: 3
4
4
---
5
5
6
+
## Styling
7
+
8
+
To change the CSS classes or other attributes assigned to a Column, use can use [setTdAttributes](../datatable/styling), which allows customising attributes based on column type, name or value.
9
+
6
10
## Sorting
7
11
8
12
See also [component sorting configuration](../sorting/available-methods).
@@ -156,6 +160,23 @@ Column::make('My one off column')
156
160
),
157
161
```
158
162
163
+
Note that any field not used elsewhere in the table, that is required (for example creating an attribute based on two unused fields, these must be added to the query with setAdditionalSelects() in the configure() method (See Here)[https://rappasoft.com/docs/laravel-livewire-tables/v3/datatable/available-methods#content-builder])
164
+
```php
165
+
public function configure(): void
166
+
{
167
+
$this->setAdditionalSelects(['users.forename as forename', 'users.surname as surname']);
The component has the ability to collapse certain columns at different screen sizes. It will add a plus icon as the left most column that will open up a view below the row with the information of the collapsed columns:
Copy file name to clipboardExpand all lines: docs/filter-types/filters-text.md
+131-1Lines changed: 131 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Text Filters
3
3
weight: 10
4
4
---
5
5
6
-
Text filters are just HTML text fields.
6
+
Text filters are just simple text filters, allowing you to pass a string value into a builder query.
7
7
8
8
```php
9
9
public function filters(): array
@@ -20,3 +20,133 @@ public function filters(): array
20
20
];
21
21
}
22
22
```
23
+
24
+
### Extra Helpers
25
+
26
+
There are a number of helpers to simplify your code, should you not wish to rewrite the filter function repeatedly for a Text Filter. You can only use one of the below methods per-filter.
27
+
28
+
#### Contains
29
+
30
+
This executes the filter and returns results where the field contains the filter value
31
+
32
+
```php
33
+
public function filters(): array
34
+
{
35
+
return [
36
+
TextFilter::make('Name')
37
+
->config([
38
+
'placeholder' => 'Search Name',
39
+
'maxlength' => '25',
40
+
])
41
+
->contains('users.name'),
42
+
];
43
+
}
44
+
```
45
+
46
+
#### notContains
47
+
48
+
This executes the filter and returns results where the field does not contain filter value
49
+
50
+
```php
51
+
public function filters(): array
52
+
{
53
+
return [
54
+
TextFilter::make('Name')
55
+
->config([
56
+
'placeholder' => 'Search Name',
57
+
'maxlength' => '25',
58
+
])
59
+
->notContains('users.name'),
60
+
];
61
+
}
62
+
```
63
+
64
+
#### startsWith
65
+
66
+
This executes the filter and returns results where the field starts with the filter value
67
+
68
+
```php
69
+
public function filters(): array
70
+
{
71
+
return [
72
+
TextFilter::make('Name')
73
+
->config([
74
+
'placeholder' => 'Search Name',
75
+
'maxlength' => '25',
76
+
])
77
+
->startsWith('users.name'),
78
+
];
79
+
}
80
+
```
81
+
82
+
#### notStartsWith
83
+
84
+
This executes the filter and returns results where the field does not start with the filter value
85
+
86
+
```php
87
+
public function filters(): array
88
+
{
89
+
return [
90
+
TextFilter::make('Name')
91
+
->config([
92
+
'placeholder' => 'Search Name',
93
+
'maxlength' => '25',
94
+
])
95
+
->notStartsWith('users.name'),
96
+
];
97
+
}
98
+
```
99
+
100
+
#### endsWith
101
+
102
+
This executes the filter and returns results where the field ends with the filter value
103
+
104
+
```php
105
+
public function filters(): array
106
+
{
107
+
return [
108
+
TextFilter::make('Name')
109
+
->config([
110
+
'placeholder' => 'Search Name',
111
+
'maxlength' => '25',
112
+
])
113
+
->endsWith('users.name'),
114
+
];
115
+
}
116
+
```
117
+
118
+
#### notEndsWith
119
+
120
+
This executes the filter and returns results where the field does not end with the filter value
121
+
122
+
```php
123
+
public function filters(): array
124
+
{
125
+
return [
126
+
TextFilter::make('Name')
127
+
->config([
128
+
'placeholder' => 'Search Name',
129
+
'maxlength' => '25',
130
+
])
131
+
->notEndsWith('users.name'),
132
+
];
133
+
}
134
+
```
135
+
136
+
#### setFieldName
137
+
An optional method for setting the field to use when filtering, if used, you may omit the field from the above methods, for example:
0 commit comments