Column action documentation

I'm trying to run the code seen here: https://filamentphp.com/docs/3.x/tables/columns/getting-started#running-actions Example code:
php

public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\Layout\Split::make([
ImageColumn::make('plate_image')
->width(200)
->height(100)
->action(function (Video $record): void {
$this->dispatch('View Video', video: $record->getKey());
})
])
])
->actions([
ActionGroup::make([
Tables\Actions\Action::make('View Video')
->form([
\App\Forms\Components\Video::make('video_filename')
->label('Video')
])->disabledForm()
])
]);
}
php

public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\Layout\Split::make([
ImageColumn::make('plate_image')
->width(200)
->height(100)
->action(function (Video $record): void {
$this->dispatch('View Video', video: $record->getKey());
})
])
])
->actions([
ActionGroup::make([
Tables\Actions\Action::make('View Video')
->form([
\App\Forms\Components\Video::make('video_filename')
->label('Video')
])->disabledForm()
])
]);
}
I get this when clicking on the image column still get redirected to the edit page. Am I doing something wrong here to make the modal appear when clicking on the image instead of redirecting to the edit page?
Using $this when not in object context
Using $this when not in object context
Solution:
ended up using $table->recordAction('View Video') ->recordUrl(null)...
Jump to solution
1 Reply
Solution
pmkevinrudd
pmkevinrudd14mo ago
ended up using $table->recordAction('View Video') ->recordUrl(null)
Want results from more Discord servers?
Add your server