Hello, We are embedding different dashboards into ...
# gooddata-ui
s
Hello, We are embedding different dashboards into our React SPA using the
sdk-ui-dashboard
package. We’d like to have a feature where filters applied in one dashboard persist when moving to another. For example: A user visits Dashboard 1 and sets the "Product Collection" filter to "Collection 1." When the user navigates to Dashboard 2, we want to restore that "Product Collection" filter to maintain consistency across dashboards. Is there a recommended approach to achieve this functionality? Any guidance would be greatly appreciated. Thanks in advance!
1
Maybe it isn't the most obvious way, but I see there is a
local_filters
entry in the localStorage, I wonder if this could be used to prepare the filters before going to another dashboard? Any advice on exploiting that? Thanks!
@Joseph Heun Hello, sorry for the ping. any advice about this enquiry?
r
Hi Simon, Radek here! Apologies for the delay 🙂 This would require you to save the filter state and apply it on Dashboard load - this'd be done using the Dashboard dispatch commands. We have an example here that showcases the use of dispatch commands for filter selection specifically; in your case, you'd have to listen for the "Dashboard initialized" event and set the filters after, they cannot be applied before the initialization. Hope this helps!