In gantt v.4.3.7 we catch update events and utilize it to catch the 'dataset' event. We utilize the 'dataset' event to manipulate some items on render. I noticed in the v5 update there is no more 'dataset' event. Is there an alternative event that is dispatched?
Support Forum
Hey quandarycg,
Probably you'll need to update the event to the change one.
https://www.bryntum.com/docs/gantt/api/Gantt/model/ProjectModel#event-change
https://www.bryntum.com/docs/gantt/api/Core/data/Store#event-change
You can also check what changes were made from one version to another here. https://www.bryntum.com/docs/gantt/api/apidiff
Best regards,
Márcio
Even going off the v5 docs I see that "catchAll" event should still work yet on v4.3.7 this works:
bryntum.query('gantt').eventStore.on('catchAll', (event) => { console.log({event}) })
in v4, there are events logged to the console
and in v5, no events are logged to the console
Is there a new method to grab the 'dataset' event?
So, the dataset now is replaced by the change method, and became a parameter, as you'll see in the documentation. I used the snippet that you shared in the Gantt basic demo and worked just fine https://www.bryntum.com/examples/gantt/basic/ as you will see in the screenshot attached, perhaps you could share a sample project with your configuration to check what could be not working??
- Attachments
-
- Screen Shot 2022-08-09 at 1.41.10 PM.png (259.29 KiB) Viewed 691 times
Best regards,
Márcio
No, I don't see the dataset there. But to achieve your goal, you can use the load event.
https://www.bryntum.com/docs/gantt/api/Scheduler/data/EventStore#event-load
Or the dataReady event in projectModel
https://www.bryntum.com/docs/gantt/api/Gantt/model/ProjectModel#event-dataReady
Best regards,
Márcio
Yes, the load event should work just like any other described in the documentation.
About the dataReady, yes, it returns the project, as also described in the documentation.
Could you please share your code for us to debug?? It'll make it easier for us to debug. Perhaps a sample project with your configuration would be very nice.
Best regards,
Márcio
Our code has production data in it. Would you be able to get the #event-load to work and provide an example? I don't see how an event dispatching has to do with the project. Isn't it built in to dispatch events?
And to the point mentioned above: I tried the event-load and it is not dispatching like all the other events (update, remove, etc..)
Hi quandarycg,
Some events are dispatched in a specific context, so you need to set up the listener in the right context to work.
To configure that load event inside the event store, you can code like this
project : {
...other configurations,
eventStore : {
listeners : {
load : (event) => {
console.log('event', event);
}
}
}
}
Best regards,
Márcio