File tree Expand file tree Collapse file tree 4 files changed +31
-4
lines changed
Expand file tree Collapse file tree 4 files changed +31
-4
lines changed Original file line number Diff line number Diff line change 22
33All notable changes to ` wire-table ` will be documented in this file
44
5+ ## 1.5.1 - 2024-06-07
6+
7+ - feat: make paginatedData an accessible computed property
8+ -
9+
510## 1.5.0 - 2024-05-10
11+
612- feat: support for pagination links on top of the table
713
814## 1.4.0 - 2024-05-08
15+
916- feat: Update support to Laravel 11
1017
1118## 1.3.0 - 2024-02-26
19+
1220- Feat: Basic support for bulk selection
1321- Renamed bootstrap theme references to bs (backward-compatible)
1422
1523## 1.2.0 - 2024-01-31
24+
1625- Feat: Added global wiretable: reload event to reload tables data
1726- Removed unused layout references
1827
1928## 1.1.2 - 2024-01-29
29+
2030- Fix: use the proper view for simple pagination links
2131
2232## 1.1.1 - 2024-01-11
33+
2334- Fix: JS error when changing sorting due to overlap between sortBy method and property
2435
2536## 1.1.0 - 2024-01-11
26- - BREAKING: ResetPageOnUpdate is not included by default, but it's automatically added when using the artisan ` make:wiretable ` command
37+
38+ - BREAKING: ResetPageOnUpdate is not included by default, but it's automatically added when using the
39+ artisan ` make:wiretable ` command
2740- Fix: updated the stub namespace to the new Livewire v3 default namespace
2841- Fix: updated PHP and Laravel dependencies according to new livewire requirements
2942
Original file line number Diff line number Diff line change 55 " tiknil" ,
66 " wire-table"
77 ],
8- "version" : " 1.5.0 " ,
8+ "version" : " 1.5.1 " ,
99 "homepage" : " https://github.com/tiknil/wire-table" ,
1010 "license" : " MIT" ,
1111 "type" : " library" ,
Original file line number Diff line number Diff line change @@ -27,10 +27,24 @@ public int $pageSize = 20;
2727
2828In case you need to reset the current page (e.g. when a filter changes), you can do so with the ` resetPage() ` method.
2929
30+ ### Paginator
31+
32+ You can access the paginator element (e.g. to retrieve the records total) with ` $this->paginatedData ` , e.g:
33+
34+ ``` php
35+ $total = $this->paginatedData->total()
36+ ```
37+
38+ > [ !IMPORTANT]
39+ > ` paginatedData ` is a livewire computed property. If you change any other property after retrieving the paginator,
40+ > those changes will not affect the query.
41+ >
42+ > It's also important to access the paginator as a property (` $this->paginatedData ` ) and not as a
43+ > method (` $this->paginatedData() ` ) to avoid query duplication.
3044
3145### Placement
3246
33- By default, pagination links and the record count are shown at the bottom, after the table.
47+ By default, pagination links and the record count are shown at the bottom, after the table.
3448You can control where to show them by overriding these variables in your component:
3549
3650```
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ public function paginatedData(): Paginator
6666 protected function layoutData (): array
6767 {
6868 return [
69- 'paginator ' => $ this ->paginatedData ,
69+ 'paginator ' => $ this ->paginatedData () ,
7070 'theme ' => $ this ->theme (),
7171 'iconTheme ' => $ this ->iconTheme (),
7272 ];
You can’t perform that action at this time.
0 commit comments