I'm working on implementing cross-filters with custom components in a React app, and I'm having some difficulty understanding how the events should be used.
Here’s what I’m currently doing:
- I listen to EmbedEvent.CrossFilterChanged to build a list of active filters and display them as chips.
- I also have a “Clear All” button that removes all filters by triggering HostEvent.UpdateCrossFilter with an empty object, which works as expected.
The challenge I’m facing is handling the removal of individual filter chips.
When a filter is removed directly from the embedded table, a CrossFilterChanged event is triggered. However, the payload only contains the filter ID, which wasn’t included in the event when the filter was originally added. Because of this, I’m not sure how to reliably match and remove the corresponding chip in my UI.
I’m also unsure about the correct approach for removing a filter from the filter component itself. Specifically, if multiple filters are applied and a user removes just one, what’s the proper way to construct and send the HostEvent.UpdateCrossFilter event so that only that specific filter is removed while the others remain active?
Any guidance on the recommended pattern for managing this would be greatly appreciated.
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community