F
Filament5mo ago
Felix

How do you make tables communicate with each other.

I want to make an page with two tables, where on the first I have an list of all talk rooms and on the second I have all the participants of the selected room. How do I make it so that both are on the same page and both are made by the filament table builder?
Solution:
it worked, thanks.
Jump to solution
12 Replies
Dennis Koch
Dennis Koch5mo ago
How would you "select" a room? Via the bulk select?
Felix
Felix5mo ago
no, an action.
Dennis Koch
Dennis Koch5mo ago
In general the logic would be to dispatch events and listen to them
Felix
Felix5mo ago
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Dennis Koch
Dennis Koch5mo ago
No I mean Livewire events: https://livewire.laravel.com/docs/events
Laravel
Events | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Dennis Koch
Dennis Koch5mo ago
Because your tables are Livewire components
Felix
Felix5mo ago
ah, I see, Thanks, and will try. 👍
Solution
Felix
Felix5mo ago
it worked, thanks.
Dennis Koch
Dennis Koch5mo ago
Wanna share your solution for anyone searching this?
Felix
Felix5mo ago
sorry, I accidentally selected the wrong post, I wanted to select your post (the livewire link), but i don’t know how to change the solution.
Dennis Koch
Dennis Koch5mo ago
You can't change it after it was selected 😅 But I meant: Do you want to share a bit of code on how you solved this?
Felix
Felix5mo ago
sure. in the dispatcher livewire: class: ->actions([ Tables\Actions\Action::make('select') ->action(function (ProjectService $record) { $this->dispatch('select_project', project: $record); }) ]) blade: <div> {{ $this->table }} @livewire('testing-service-list',['project' => $selectedProject]) </div> in the dispatched livewire: #[On('select_project')] public function showSelectedProjectServices($project) { $this->project = $project; }