Table update after action
Hi, im using filament as livewire components without full panel.
On user detail page I have user infolist component - there is section with headerActions (form for adding user documents) and user document table inside schema.
what is correct way to update user document table to show updated data after create (or edit/delete) in my case?
thank you!
8 Replies
Dispatch a refresh to your livewire component.
refresh whole component is only (correct) way when using standalone components? there is no way to reload only data on filament table or smth like this? thank you @awcodes
Unless you have nested components then you have to refresh the whole component. Technically you shouldn’t have to if the data changes. The data change should just automatically do a rerender. Maybe also look into computed properties in livewire.
not automatically re-rendered in my case, probably i have something wrong
probably bcs i have it as Livewire::make 🤔
im using
because i want reuse existing table code, is there better way how to do it maybe?
You should be able to dispatch a refresh to that specific component.
Check out the livewire docs
A computed property for the user might be better though.
yes, emitting on whole component is working ofc, thx
computed property probably should be on documents as table showing documents in rows, user is only for filtering
Yea. Makes sense though. You need table to refresh and the main component is in charge of the table.
hmm is strage dispatch not working from inside of method, but only when its directly fired from action like this:
but i understand its more like livewire problem and not filament
it's a pity that there is no way to insert the form from another file like nested component into section section (or into tab directly) and must be used Livewire here