F
Filamentβ€’11mo ago
Milorn

Refresh tab badge

How can i refresh the tab badges count after changes in the table ? Right now when i move the rows from one tab to another, the counts are always one time behind, like they get refreshed on the next one instead of when the change happens.
No description
3 Replies
gizmojo
gizmojoβ€’6mo ago
Did you find a solutions for this?
Tally
Tallyβ€’6mo ago
in your ToggleColumn you can fire an event
->afterStateUpdated(fn($livewire) => $livewire->dispatch('refresh') ),
->afterStateUpdated(fn($livewire) => $livewire->dispatch('refresh') ),
in your ListResource you then listen for that event on the getTabs() function like this
#[On('refresh')]
public function getTabs(): array
{
// tabs
}
#[On('refresh')]
public function getTabs(): array
{
// tabs
}
gizmojo
gizmojoβ€’6mo ago
Cheers that worked on the EditResource's relation manager too πŸ‘
#[On('refreshRelationManagers')]
public function getRelationManagers(): array
{
return parent::getRelationManagers();
}
#[On('refreshRelationManagers')]
public function getRelationManagers(): array
{
return parent::getRelationManagers();
}
Want results from more Discord servers?
Add your server