popup

i want to create button in table row and when i click buttoni want to show popup with new table
22 Replies
Dennis Koch
Dennis Koch10mo ago
Use an Action with ->modalContent()
with new table
What's the "new table"?
gigiloouu
gigiloouuOP10mo ago
like i have table of workers list i want to have button somewhere for all workers and if i click id1 worker button show popup new table about this worker data lets say
gigiloouu
gigiloouuOP10mo ago
i sew this but its not works also im using v2
Vp
Vp10mo ago
I think this is what you need, but instead of "BulkAction" you should use action. https://filamentphp.com/docs/2.x/tables/actions#custom-content
gigiloouu
gigiloouuOP10mo ago
why bulkactions dont show? i wrote this but its dont showed ->bulkActions([ Tables\Actions\DeleteBulkAction::make('aaa'), Tables\Actions\BulkAction::make('updateAuthor') ->action(function (Supplier $records, array $data): void { foreach ($records as $record) { $record->author()->associate($data['authorId']); $record->save(); } }) ->form([ Forms\Components\Select::make('authorId') ->label('Author') ->options(User::query()->pluck('name', 'id')) ->required(), ]) ]);
Vp
Vp10mo ago
Bulk action is for "bulk", check rows using checkbox and on top of table you'll see your bulk actions
gigiloouu
gigiloouuOP10mo ago
okay but i want to be this action always not when i check
Vp
Vp10mo ago
try this, in ->modalContent() you provide your table
gigiloouu
gigiloouuOP10mo ago
oho i made it i just change bulkaction to action and its works now thanks Vp ❤️
Vp
Vp10mo ago
That's what I said..
gigiloouu
gigiloouuOP10mo ago
hm but
Vp
Vp10mo ago
welcome
gigiloouu
gigiloouuOP10mo ago
its possible to make new table inside the action right ?
Vp
Vp10mo ago
try like this
gigiloouu
gigiloouuOP10mo ago
i should create view? and what i should write inside this view? @Vp
Vp
Vp10mo ago
Yes, and inside the view you write your table..
gigiloouu
gigiloouuOP10mo ago
can u give me some example? i have no idea if u have already writted please
Vp
Vp10mo ago
Ok, wait
Dennis Koch
Dennis Koch10mo ago
You can reuse the blade components inside the view. But you cannot embed another filament table in the modal Your HTML/Blade
Vp
Vp10mo ago
HTML table... <table></table>
Want results from more Discord servers?
Add your server