I'm trying to set the selected values for the resourceFilter, it does set as i can log it in the console but only one resource is checked in the resources in the sidebar
It's as simple as calling deselectAll();select(<an array of ids>) as the API docs describe.
Thanks it does work as expected, but I am now facing new issues with approach, I am unable to deselect resources again or close a resource with the X button. What am I doing wrong?
Re: Set selected resources
Posted: Fri May 26, 2023 9:17 am
by Animal
Setting the selection on startup won't affect that. We need to see exactly what you're doing.
Re: Set selected resources
Posted: Fri May 26, 2023 9:19 am
by Animal
It sounds like that code is being executed again when you deselect resources again or close a resource with the X button, so it's reselecting.
You are right, it is indeed reselecting, i am selecting all when data changes because different resources are loaded for each date but it seems deselecting a resource emits a dataChange too. Is there a better way i can do it?
Re: Set selected resources
Posted: Fri May 26, 2023 10:53 am
by Animal
Deselecting a resource will cause the eventStore to recalculate its filtered state.
This will emit a change event (Not a "dataChange" event) with the triggering action:
Screenshot 2023-05-26 at 10.49.13.png (189.26 KiB) Viewed 335 times
Re: Set selected resources
Posted: Fri May 26, 2023 12:12 pm
by orthobridge
Deselecting a resource does fire the calendar dataChange event too