© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•13mo ago•
35 replies
WashingtonG

Custom Table Action and polling

I have a table that polls data every 5 seconds (and it's configurable), I added two actions to that table widget, a built-in one (a EditAction) and a custom that has a custom view and a trigger. For some reason the standard action is always click-able, meanwhile the custom action is not always clickable.

Table widget:
...
return $table
    ->emptyStateHeading('No Active Calls')
    ->poll(config('widgets.poll'))
    ->striped()
    ->columns([
        Tables\Columns\TextColumn::make('name')
            ->size(TextColumnSize::ExtraSmall)
            ->wrap()
    ])
    ->actions([
        Tables\Actions\EditAction::make(),
        Tables\Actions\Action::make('custom')
            ->view('filament.company.tables.modals.custom')
            ->visible(fn($record) => $this->spyVisibility($record))
            ->action((function ($record) {
                Log::debug($record);
                // This code is never executed
            })),
        
        ]);
...
return $table
    ->emptyStateHeading('No Active Calls')
    ->poll(config('widgets.poll'))
    ->striped()
    ->columns([
        Tables\Columns\TextColumn::make('name')
            ->size(TextColumnSize::ExtraSmall)
            ->wrap()
    ])
    ->actions([
        Tables\Actions\EditAction::make(),
        Tables\Actions\Action::make('custom')
            ->view('filament.company.tables.modals.custom')
            ->visible(fn($record) => $this->spyVisibility($record))
            ->action((function ($record) {
                Log::debug($record);
                // This code is never executed
            })),
        
        ]);


And the blade view:
<x-filament::modal id="spy-modal" icon="heroicon-m-puzzle-piece" alignment="center" :extra-modal-window-attribute-bag="$action?->getExtraModalWindowAttributeBag()">
    <x-slot name="trigger">
        <x-filament::button icon="heroicon-m-puzzle-piece" x-on:click="window.dispatchEvent(new Event('js-modalopen-hndlr'));" />
    </x-slot>

    <x-slot name="heading">
        Demo
    </x-slot>
</x-filament::modal>
<x-filament::modal id="spy-modal" icon="heroicon-m-puzzle-piece" alignment="center" :extra-modal-window-attribute-bag="$action?->getExtraModalWindowAttributeBag()">
    <x-slot name="trigger">
        <x-filament::button icon="heroicon-m-puzzle-piece" x-on:click="window.dispatchEvent(new Event('js-modalopen-hndlr'));" />
    </x-slot>

    <x-slot name="heading">
        Demo
    </x-slot>
</x-filament::modal>


According to Filament documentation, that's all I need to add to make this work. The question is, what else should I add to the trigger in order to make it work?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Table Polling
FilamentFFilament / ❓┊help
14mo ago
Custom Table Action
FilamentFFilament / ❓┊help
3y ago
Modal action polling
FilamentFFilament / ❓┊help
2y ago
Custom table row action
FilamentFFilament / ❓┊help
3y ago