Auth1Specialist
Auth1Specialist
FFilament
Created by Auth1Specialist on 1/22/2025 in #❓┊help
Triggering editaction on Stat click
Hi all, I have been trying to add a click event to trigger a "editAction". The event gets dispatched, but the modal (/slideover) does not show. When I trigger the action directly, the modal does show. This is how I am trying to achieve this:
return [
Stat::make($this->widget->name, reset($stats))
->description(new HtmlString($this->widget->description))
->extraAttributes([
'class' => 'cursor-pointer widget-edit-hover transition-all duration-300 ease-in-out',
'wire:click' => "\$dispatch('widget-edit', { id: " . $this->widget->id . " })",
])
->descriptionIcon('heroicon-m-arrow-trending-up')
->color($this->widget->color)
];
return [
Stat::make($this->widget->name, reset($stats))
->description(new HtmlString($this->widget->description))
->extraAttributes([
'class' => 'cursor-pointer widget-edit-hover transition-all duration-300 ease-in-out',
'wire:click' => "\$dispatch('widget-edit', { id: " . $this->widget->id . " })",
])
->descriptionIcon('heroicon-m-arrow-trending-up')
->color($this->widget->color)
];
#[On('widget-edit')]
public function editDashboardAction(string $id): EditAction
{
$widget = Widget::query()->find($id);
ray($widget);
return EditAction::make('editDashboard')
->model(Widget::class)
->record($widget)
->form(Widget::form())
->after(function () {
$this->dispatch('$refresh');
})
->slideOver();
}
#[On('widget-edit')]
public function editDashboardAction(string $id): EditAction
{
$widget = Widget::query()->find($id);
ray($widget);
return EditAction::make('editDashboard')
->model(Widget::class)
->record($widget)
->form(Widget::form())
->after(function () {
$this->dispatch('$refresh');
})
->slideOver();
}
- I have confirmed the function gets called on Click - I have confirmed the modals code itself is loaded on the page Thanks for the help!
5 replies
FFilament
Created by Auth1Specialist on 12/14/2024 in #❓┊help
Repeater optimistic UI with livewire
Hi all, Does anyone have any pointers on how to implement an optimistic UI using the Livewire repeater? I was thinking of using alpine to do so, so I was wondering if anybody already attempted something similar / has any pointers on this. Thanks!
7 replies