Reset in columns toggleable?
I see that the ability to make a table's toggle clear has not been deployed?
Do you know a method to reset columns toggleable to their default values?
thx
10 Replies
or a method to go back to default table?
Not sure but I think the visible columns are stored in the browser local storage... maybe you can add a button in your page to clear it
Ok, I see. But how can I get default values of these columns to inject in a new session? Thank's the response π
Right, so it's stored in the PHP session, not local storage.
Just did a quick test, this will reset to the default columns on a ListPosts page:
Many thanks @pboivin and for anyone looking to reset all table action sessions through a button for example:
session()->remove('tables');
Do you know if it is possible to display a button at the end of table lookup or other table actions like for a Filament::registerRenderHook() ?
I'm not sure... where exactly do you want to add the button?
I want to add a button at the end of the toggle button or filters. I searched in the documentation but Filament doesn't have renderHooks in the toolbar header table.
So I created lots of simple render hooks that work like a charm in the toolbar header table. This would make Filament even more flexible but I don't know if @Dan Harrin is interested by this option. If he is interested, I propose me to make a pull request and add the renderHooks to the documentation?
It's only renderHooks like this :
{{ \Filament\Support\Facades\FilamentView::renderHook('panels::resource.pages.list-records.table.filters.end', scopes: $this->getRenderHookScopes()) }}
and more...
Looks good to me, I would say take a chance and send a PR π
This would be a really nice addition to core π (Just like filters adding a Reset button)