Can dashboard page react to filters?
Hello, I am currently building a custom dashboard that has filter, with
use HasFiltersForm;
and have added some simple toggle buttons to the filter ("today", "last 7 days", "last 30 days"). that sort of thing.
The widgets are reacting with the filter with the use of use InteractsWithPageFilters;
However i want to display some basic text to let the user know the date period that they selected. Since the dashboard has no blade file (that I know of), is there anywhere I can hook this information? besides putting them on individual widget itself which will clutter it with dates.
Currently what I did was adding it to the filtersForm
method, however the data is not 'reactive' its working, but it is lagging behind
Here's my code
2 Replies
The Text::make() won't update because filtersForm likely isn't re-rendered. You should instead use a callback like so:
However i want to display some basic text to let the user know the date period that they selected. Since the dashboard has no blade file (that I know of), is there anywhere I can hook this information? besides putting them on individual widget itself which will clutter it with dates.I'm not an expert but you could have your own custom dashboard view file. It's looks to be just a basic page with the following: You could then put a banner at the top or something and you can access the Dashboard livewire component like usual. If you could tell where the perfect place for the date message to go, it might spark an idea.
Thanks. I'll give it a try