F
Filament13mo 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
gizmojo8mo ago
Did you find a solutions for this?
Tally
Tally8mo 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
gizmojo8mo 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();
}

Did you find this page helpful?