Skip to content

Multi table pagination#497

Draft
elegasoft wants to merge 4 commits into
MedicOneSystems:masterfrom
elegasoft:multi-table-pagination
Draft

Multi table pagination#497
elegasoft wants to merge 4 commits into
MedicOneSystems:masterfrom
elegasoft:multi-table-pagination

Conversation

@elegasoft

Copy link
Copy Markdown

Resolves #496: Allow for independent query string pagination with multiple datatables on the same page

Function:

By using the WithMultiTablePaginator one can rely on the query string parameters to separately paginate multiple LivewireDatatable's which are rendered on the same page.

Requirements:

Requires that the DataTableComponent use WithMultiTablePaginator; and declare either a $pageName or $name property on the DataTableComponent.

class WorkInProgressDataTable extends LivewireDatatable
{

    use WithMultiTablePaginator;

    /// Requires declaration of $name
    public $name = 'wip';

    /// or declaration of 
    public $pageName = 'wipPage';
   ...
}

How it works:

  1. The WithMultiTablePaginator overrides all pagination related calls to ensure that it applies the $pageName or LivewireDatatable $name properties.
  2. It also ensures that calls to the getResultsProperty() also paginates based on the page related to $pageName or LivewireDatatable $name property.

Tests:

-- Work In Progress --

Discussion Points:

  1. Naming seems to be a bit off, maybe rename the trait to WithCustomPaginator?
  2. There are no other Exceptions thrown by this plugin, instead of throwing an exception we can provide a default $pageName using static::class?

Handles the condition of a $pageName or $name not being supplied for use as a query string
Comment thread src/Exceptions/PageNameNotFoundExecption Outdated
@thyseus

thyseus commented Aug 10, 2022

Copy link
Copy Markdown
Collaborator

I like the idea with using Traits a lot, but shouldnt it be possible to use multiple tables on the same page by default without using a Trait ?

@mrtorks

mrtorks commented Feb 21, 2023

Copy link
Copy Markdown

Hi all. Any update in this feature. It would really be awesome to have this implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow for independent query string pagination with multiple datatables on the same page

3 participants