MedicOneSystems / MedicOneSystems/livewire-datatables
Allow for independent query string pagination with multiple datatables on the same page
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 257
- PR merge metrics
- No merged PRs in 30d
Description
Issue:
If you have multiple DataTables on the same page and you try to paginate one of the DataTables it will appear to only paginate the one DataTables. However, if you refresh the page, all DataTables which are rendered on that page will respond to ?page= queryString and all the tables will jump to the same page. This can mean that a DataTable which does not have the minimum number of pages will render a statement of There's Nothing to show at the moment without rendering it's pagination section leaving that table useless.
Steps to Reproduce:
- Have to two or more DataTables render on the same page with one table that has more pages than the another
- Paginate to a page which is beyond that of the DataTable with the lesser number of pages
- Reload/Refresh the browser window
- You'll see
There's Nothing to show at the momenton the DataTable with the lesser number of pages and there won't be a way to get that table back to a page which does exist without reloading the page in a way which removes the query string parameter for?page=
Solution:
Allow setting a $pageName variable for each DataTable thereby mitigating the issue of multiple DataTables responding to the same query string parameters.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the DataTable pagination entry point and how the ?page= query parameter is read for each table. Add per-table $pageName configuration, then reproduce the two-table case and verify that each table retains its own page and valid pagination after a refresh.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100