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
})),
]);
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>
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?