Our powerful JS Calendar component


Post by dwilliams »

Hello,

I have 2 questions.

  1. I am looking for an event that fires after the EventStore is completely ready so I can use the "getEvents" method. In React, I have been using a useEffect hook that checks if calendar.current.instance is available, but sometimes it gets the events and sometimes it doesn't. Is there an event trigger or a certain place in the configuration where I would want to set up the getEvents method to run automatically that will only run after the events are available in the EventStore?

The getEvents method accepts a filter function as a parameter in addition to the startDate and endDate, but there is no example of how to write that filter function so that it targets the events. Could I get a specific example of how to write that filter function so that it targets the events being passed in? I have tried passing in a function like this filter: (e) => e.status === 0, but that doesn't work.

Regards,

Dan

Last edited by dwilliams on Mon Oct 04, 2021 2:39 pm, edited 1 time in total.

Post by mats »

If you just want to query events by some field, you should use https://bryntum.com/docs/gantt/#Core/data/mixin/StoreSearch#function-query but if you do need to use getEvents to apply a date range, please show us your code so we can debug it.

Please start a new thread for your second question.


Post by dwilliams »

Ok, I edited the post and moved the second question to a new thread. I'm working on using the solution above.

Regards,

Dan


Post Reply