laravel-splade
laravel-splade copied to clipboard
Problems with several x-splade-tables on same page
- 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...
I still have not found a solution and it is a blocker. Has no one experienced this problem in some other project?
I had this problem, it doesn't work at all
mbeckerle-xqueue
I can confirm this.
The same problem
@pascalbaljet any updates on this issue, because this is a show stopper
I have the same problem