1

I'm using the reactive search on a react web app and I'm trying to find a way to be able to switch from "all items" to "favorite items" for which I have an array of ids.

I've tried three different strategies, but none appears satisfying:

  1. I've set up a DataController with a custom query on "terms", but it only works one way : I can filter the items, but then I can't unfilter them and get back to the unfiltered.

  2. I also tried to use the multilist dropdown with the defaultSelected prop but then if I clear the filter I can't find a way to programmatically set the values.

  3. Eventually I can provide my own filter inside the onData function and choose to show / not show the item whether it appears on the list of ids - but this feels hacky and I'd prefer - if possible - to integrate the functionality directly to the reactiveBase.

What would be the best strategy to achieve this ?

Timisorean
  • 1,388
  • 7
  • 20
  • 30

1 Answers1

1

This appears to be the best solution :

1- I need to set a new query each time there is a change in the component's value.

2- The only way to get a "setQuery" function as prop is by using a ReactiveComponent and not a DataController (I wonder what is the use of DataController then !).

3- ReactiveComponent is correctly demonstrated here.