I realised I couldn't use onEventCreated since I needed information about the resource, so I switched to listening to 'beforeeventadd' instead, which sends along the resourceRecord in the fireEvent.
But why not add that argument as well to the onEventCreated call as well? The info is there.
SchedulerView.js:
if (this.fireEvent('beforeeventadd', this, newEventRecord, resources) !== false) {
this.onEventCreated(newEventRecord);
Actually, that moved line makes my initial problem when using onEventCreated even worse
I have other code listening to the store's events, so other stuff happen when that eventStore.append() is executed, thus I needed the onEventCreated to do as much as possible with the record's data before it gets attached to the store.
listening to the event works perfectly fine for me at the moment. It was just that I noticed when looking at the code that the resource could easily be included in the call, and so I thought I drop you a line about it, as the onEventCreated was the documented way of attaching into this process and thus looked like the preferred way.
PS.
You still have plugin.CellPlugin that callls onEventCreated before the record is added to the store, so you now have two different situations inside that function call.
You still have plugin.CellPlugin that callls onEventCreated before the record is added to the store, so you now have two different situations inside that function call.
Good point, amended now - this should make the method much more useful as you have access to the resource(s) now.