If I understood correctly, you want to access the eventStore and assignmentStore and manipulate some records, you can access it using source param in the event onEventDrop. It will be something like this:
I need to you define your use case here, like what you are trying to achieve. Then we will be in a better position to suggest you the best solution.
Here's a scenario: If you want to update a specific record, you can update do something like this:
source.eventStore.getById(recordIdYouWantToUpdate).set('name', 'hello')
source.assignmentStore.getById(AssignmentRecordIdYouWantToUpdate).set(//your field and value)
yes that is what im trying to achieve. Upon updating the eventStore, how do I get the latest events data? I tried to get the eventStore.data (eventStore passed as props to BryntumSchedulerPro), but the data resource is not updated. I do not want to fetch the ModelClass from the eventStore.
const [eventStore, setEventStore] = useState({
data: null
});
//on initial fetch of data from API
setEventStore(prev => ({ ...prev, data: response.data.events }));
//Bryntum config
<BryntumSchedulerPro
{...schedulerConfig}
startDate={startDate}
endDate={endDate}
resources={resources}
eventStore={eventStore}
assignments={assignments}
onEventDrop={(data) => handleEventDrop(data, orgScheduleRef)}
key={`${resources} ${subTypes}`}
ref={orgScheduleRef}
/>
Can you please elaborate a bit what you are trying to achieve? By "I do not want to fetch the ModelClass from the eventStore" you mean, you do not want to use source.eventStore.getById(recordIdYouWantToUpdate) this to get the event?
I will like to get the list of json object of all the events - like what I can retrieve from (BryntumSchedulerPro props) eventStore.data / source.eventStore._data. But i noticed these does not return me the latest data. source.eventStore.data is returning me as undefined. Please advise how to retrieve the json object of all the events, I do not want to retrieve the ModelClass of the events.
source.eventStore.records //visible records
source.eventStore.allRecords // all records
This will return all the data. You can access the json data by using record.data. But all the records will be model classes. Please note that there is no way that you can get all the json.