Request new features or modifications


Post by MagnusN »

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);

Post by Terence »

I think this is a valid request, created ticket.

https://app.assembla.com/spaces/bryntum ... ed/details

Post by mats »

In the latest nightly, onEventCreated is called later where the Event has info about Resource - try it out?

Post by MagnusN »

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.

Post by mats »

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.

Post Reply