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 Koch4mo ago
Use an Action with ->modalContent()
with new table
What's the "new table"?
gigiloouu
gigiloouu4mo 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
gigiloouu4mo ago
i sew this but its not works also im using v2
Vp
Vp4mo 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
gigiloouu4mo 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
Vp4mo ago
Bulk action is for "bulk", check rows using checkbox and on top of table you'll see your bulk actions
gigiloouu
gigiloouu4mo ago
okay but i want to be this action always not when i check
Vp
Vp4mo ago
try this, in ->modalContent() you provide your table
gigiloouu
gigiloouu4mo ago
oho i made it i just change bulkaction to action and its works now thanks Vp ❤️
Vp
Vp4mo ago
That's what I said..
gigiloouu
gigiloouu4mo ago
hm but
Vp
Vp4mo ago
welcome
gigiloouu
gigiloouu4mo ago
its possible to make new table inside the action right ?
Vp
Vp4mo ago
try like this
gigiloouu
gigiloouu4mo ago
i should create view? and what i should write inside this view? @Vp
Vp
Vp4mo ago
Yes, and inside the view you write your table..
gigiloouu
gigiloouu4mo ago
can u give me some example? i have no idea if u have already writted please
Vp
Vp4mo ago
Ok, wait
Dennis Koch
Dennis Koch4mo ago
You can reuse the blade components inside the view. But you cannot embed another filament table in the modal Your HTML/Blade
Vp
Vp4mo ago
HTML table... <table></table>