How do I refresh my table when I interact with a ToggleColumn?
Is there an easy way to make ToggleColumn::make() reactive, or to get it to refresh the entire table after being toggled? I have other columns that depend on the state of these toggles, but I can't get the updates to the browser without refreshing the page manually.
I've tried things like $this->dispatch('$refresh') from different column callbacks, etc but without any luck. Adding <button wire:click="$refresh">Refresh component</button> to a button works, but I want the table to refresh when the toggle is toggled.
ToggleColumn::make('roles.role_full_access')->afterStateUpdated(function ($state, $record) { $this->dispatch('$refresh'); // Doesn't cause table refresh})
ToggleColumn::make('roles.role_full_access')->afterStateUpdated(function ($state, $record) { $this->dispatch('$refresh'); // Doesn't cause table refresh})