Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with several x-splade-tables on same page #471

Open
mbeckerle-xqueue opened this issue Jul 7, 2023 · 6 comments
Open

Problems with several x-splade-tables on same page #471

mbeckerle-xqueue opened this issue Jul 7, 2023 · 6 comments

Comments

@mbeckerle-xqueue
Copy link

  • Laravel Version: 10.14.1
  • PHP Version: 8.1.2
  • Splade JS Version (npm): 1.4.11
  • Splade PHP Version (composer): 1.4.15.1
  • Dev environment (OS, Sail/Valet/etc): ...

Description:

In my project I have several tables on a single page. When I search or filter, it does not take care of which table I filter for. It just appends some generric parameter to the URL causing ALL tables to execute the command, e.g. edit?sort=name.
If some table does not support sorting by name, it will fail. If all tables support it... all tables will be sorted.

I tried using ->name(...) on the tables but aparently with no effect.

Before Splade, I used protonemedias vue tables: https://github.com/protonemedia/inertiajs-tables-laravel-query-builder

Here I had a section about "Multiple tables per page" where it explained, that I have to set some keys, e.g. InertiaTable::updateQueryBuilderParameters('companies'); for the query builder (some kind of prefix), set the page name: ->paginate(pageName: 'companiesPage') and finally set a name for the table (in controller as well as the vue file): name="companies"

Then, if you searched or sorted, it prepended that name/key so you were able to have n tables on the same page and sorting organization table by name would generate some url parameter with ?organizations.name=whatever etc.

I assumed it is possible but this is also where I finally gave up. Either it is missing or documentation needs to be updated. Thank you for looking into this.

Steps To Reproduce Issue:

Add two tables on same page and try to sort/filter one without sorting the other...

@mbeckerle-xqueue
Copy link
Author

I still have not found a solution and it is a blocker. Has no one experienced this problem in some other project?

@joaovdiasb
Copy link

I had this problem, it doesn't work at all

mbeckerle-xqueue

@EmilMoe
Copy link

EmilMoe commented Aug 24, 2023

I can confirm this.

@barnoma-soz
Copy link

The same problem

@sirikkoster
Copy link

@pascalbaljet any updates on this issue, because this is a show stopper

@benguyucel
Copy link

I have the same problem

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

No branches or pull requests

6 participants