tommythecoat
How to open modal by clicking table column?
So the view I passed pointed to a livewire button component and using wire:click I passed the $getRecord()->id to the popUpModal method on my Table component and saved it to a selectedRecordId variable that I could pass back to the modal within my table blade component
49 replies
How to open modal by clicking table column?
Have you tried using the $getRecord() method in your blade file? I know this works with a ViewColumn but not tried in conjunction with modalContent. If it works you shouldn't even need to use the callback in modalContent
49 replies
How to open modal by clicking table column?
Looks like this could be useful (from docs) but not tried it:
#Passing data to the custom modal content
You can pass data to the view by returning it from a function. For example, if the $record of an action is set, you can pass that through to the view:
use Illuminate\Contracts\View\View;
Action::make('advance')
->action(fn (Contract $record) => $record->advance())
->modalContent(fn (Contract $record): View => view(
'filament.pages.actions.advance',
['record' => $record],
))
49 replies
How to open modal by clicking table column?
Personally I used the ViewColumn feature and built a livewire component to use a button within the cell which triggers a showModal() method and then the blade injection function $getRecord(). Not sure if this is the most ideal way but it worked for my purpose 😁
49 replies