Our state of the art Gantt chart


Post by ahmad.siddique »

Hi All,
I have an issue.

When assigning a resource to a task and pressing undo/redo it only gives the resources being added or removed in the modelList prop.

there is no oldData prop to compare the changes in the queue.

I have to send the request to the backend with updated assigned resources and because there is no oldData to compare I cannot generate a new list with updated resources.

Screenshot 2024-03-20 at 3.39.54 PM.png
Screenshot 2024-03-20 at 3.39.54 PM.png (231.32 KiB) Viewed 144 times

Post by alex.l »

Hi,

Could you please show us how do you get changes? Why don't you use ProjectModel/Store level to handle data changes?

All the best,
Alex


Post by ahmad.siddique »

Hi Alex

Sorry, I didn't get your point here. What do you mean by

Why don't you use ProjectModel/Store level to handle data changes?

I am trying to implement functionality for undo-redo and I am getting all the changes from STM.

I don't see the point of using ProjectModel/Store for undo-redo functionality when we have STM for it.

Can you please explain a bit more? Thanks


Post by alex.l »

Don't we talk about saving data on server? STM just manage state, but all data change tracked by ProjectModel and persisted in projectModel.changes property and can be cached with https://bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#event-change event.
Maybe I misunderstood the use case?

All the best,
Alex


Post by ahmad.siddique »

Yes, you are right about the part of saving data on the server.

The thing I am trying to say is that when we press the undo button an event is fired with a transaction from STM and then I can update the data accordingly on the server.
If I don't have enough data in STM transactions I won't be able to save data on the server properly.

What you are trying to say is that I should get the changes from projectModel. In that case, I would not know which change should I get because I won't know what the user is trying to undo or redo.


Post by ghulam.ghous »

Hi Ahmad,

I have opened a feature request for this here https://github.com/bryntum/support/issues/8848. You can subscribe to it to keep track of updates.

Regards,
Ghous


Post by ahmad.siddique »

Thanks Ghous.


Post Reply