Execution Order Change Causing Filter Value Mismatch in Filament-v3 Widget #9295
AsutoshBaral
started this conversation in
General
Replies: 2 comments 3 replies
-
I am also facing the same issue. Please help to fix this issue. Thank you. |
Beta Was this translation helpful? Give feedback.
3 replies
-
I also encountered the problem. I use getTableQuery() and Sushi to get data from an external service. Previously I used getTableFilterState() and passed it to the external service, now it does not work. Now getTableQuery() is called twice and the first time has old filter values, at the time of the second call Sushi has already received the data and does not request them again |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have designed a filter inside a widget that extends from TableWidget. Within this widget, I have implemented two functions: getTableQuery() and getTableFilters().
Now, I am in the process of upgrading this widget from Filament-v2 to Filament-v3. In Filament-v2, getTableFilters() is executed first, and based on its output, getTableQuery() is subsequently executed. However, in Filament-v3, the order of execution has changed. It now directly executes getTableQuery, and this change is causing issues, as when I select a value from the filter, the data is not fetched correctly.
Is there any alternative method or solution available that would allow me to access the current filter value?
in the v2 it is written like this $month_selected = $this->getTableFilterState("attendance_month")["value"];
while getTableFilterState() is not working in v3 so in the v3 i write like this $month_selected = $this->tableFilters['attendance_month']['value'];
Initially, when I dump $month_selected in version 3, it returns a null value. However, after selecting another month, such as April, and then dumping $month_selected, it displays the previously selected month, in this case, October.
and also when i dd($this->tableFilters) it returns a null value.
In Filament-v2, getTableFilters() executes first, and then getTableQuery(), which works perfectly. In Filament-v3, getTableQuery() executes first, causing this issue. Any insights on how to address this problem would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions