File tree Expand file tree Collapse file tree 4 files changed +30
-4
lines changed Expand file tree Collapse file tree 4 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,13 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
4
4
5
5
## [ Unreleased]
6
6
7
+ ## [ 0.1.3] - 2020-05-12
8
+
9
+ ### Changed
10
+
11
+ - Ability to turn off per page option while keeping pagination on
12
+ - Fix the search feature if pagination is on, and you're not searching from the first page using Livewire's native resetPage() method.
13
+
7
14
## [ 0.1.2] - 2020-04-28
8
15
9
16
### Changed
@@ -20,6 +27,7 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
20
27
21
28
- Initial release
22
29
23
- [ Unreleased ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.2...development
30
+ [ Unreleased ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.3...development
31
+ [ 0.1.3 ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.2...v0.1.3
24
32
[ 0.1.2 ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.1...v0.1.2
25
33
[ 0.1.1 ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.0...v0.1.1
Original file line number Diff line number Diff line change @@ -177,7 +177,8 @@ You can override any of these in your table component:
177
177
178
178
| Property | Default | Usage |
179
179
| -------- | ------- | ----- |
180
- | $paginationEnabled | true | Displays per page and pagination links |
180
+ | $paginationEnabled | true | Enables or disables pagination as a whole |
181
+ | $perPageEnabled | true | Displays per page |
181
182
| $perPageOptions | [ 10, 25, 50] | The options to limit the amount of results per page |
182
183
| $perPage | 25 | Amount of items to show per page |
183
184
| $perPageLabel | Per Page | The label for the per page filter |
Original file line number Diff line number Diff line change 1
1
@if ($paginationEnabled || $searchEnabled )
2
2
<div class =" row mb-4" >
3
- @if ($paginationEnabled )
3
+ @if ($paginationEnabled && $perPageEnabled )
4
4
<div class =" col form-inline" >
5
5
{{ $perPageLabel } } :   ;
6
6
22
22
<div class =" col" >
23
23
<input
24
24
@if (is_numeric ($searchDebounce ) ) wire:model.debounce.{{ $searchDebounce }}ms =" search" @endif
25
- @if ($disableSearchOnLoading ) wire:loading.attr =" disabled" @endif
25
+ @if ($disableSearchOnLoading ) wire:loading.attr =" disabled" @endif
26
26
class =" form-control"
27
27
type =" text"
28
28
placeholder =" {{ $searchLabel } }"
Original file line number Diff line number Diff line change @@ -18,6 +18,14 @@ trait Pagination
18
18
*/
19
19
public $ paginationEnabled = true ;
20
20
21
+ /**
22
+ * Whether or not the per page checker is visible
23
+ * Can have pagination on with the per page off.
24
+ *
25
+ * @var bool
26
+ */
27
+ public $ perPageEnabled = true ;
28
+
21
29
/**
22
30
* The options to limit the amount of results per page.
23
31
*
@@ -38,4 +46,13 @@ trait Pagination
38
46
* @var string
39
47
*/
40
48
public $ perPageLabel ;
49
+
50
+ /**
51
+ * https://laravel-livewire.com/docs/pagination
52
+ * Resetting Pagination After Filtering Data.
53
+ */
54
+ public function updatingSearch (): void
55
+ {
56
+ $ this ->resetPage ();
57
+ }
41
58
}
You can’t perform that action at this time.
0 commit comments