How to synchronize 2 filters
Hi Guys,
The requirement is that i have a dashboard need to access 2 different datasource.
The 1st widget(table) is extract data from datasource 1, and there is a filter1: serial number
The 2nd widget(table) extract data from datasource 2. and the 2nd table also have a column named serial number.
We want to achieve that when user do a filter by filter1, the widget1 data refreshed, and also impact to the 2nd widget to reload data base on the filter 1's selection immediately.
As i know the filter is also mapping to a special datasource, so it seems not impact widget 2 when i change filter1's value. Any one knows how to do this?
I also try to add 2 different filters, 1st filter is for widget1, 2nd filter is for widget2. Is there a work around solution that 2nd filter can synchronize with 1st filter?
Hello!
Kindly advice you to use 'filterschanged' (https://sisense.dev/guides/customJs/jsApiRef/dashboardClass/#filterschanged) event to develop dashboard script with the following logic:
- when 'filterschanged' is triggered and there is Filter1 in the arguments (can be checked by jaql.dim), update Filters2 filter property to be the same using dashboard object and dashboard.refresh() or native methods to update filters such as filters.update (https://sisense.dev/guides/customJs/jsApiRef/dashboardClass/dashboard-filters.html#:~:text=item-,update,-remove)
Best regards,