Our state of the art Gantt chart


Post by SIM-LTD »

Hi

If we take into account that the baseline (array) is a part of the Task of the Gantt (TaskStore) (Look at the first screenshot). Why any changes on the baselines do not affect the listener set on the TaskStore.

Indeed, no matter if any baselines (Array that can contain many baselines) are updated the changes are not fired?

A simple test can be done by going to online demo (https://www.bryntum.com/examples/gantt/baselines/ )
Then add the code below.
      gantt.taskStore.on({
         change(event) {
                   console.log('Task on Change ....', event);
         }      
      });
You can set any baseline the changes are not fired;
knowing that the baselines is a part of the task Gantt record, why any changes of the other properties (date/name/percenttDone....) are monitored while the baselines are not?

Then, is it possible to listen to changes on Baseline ? or is this just a small issue.
Attachments
Capture d’écran 2019-09-17 à 14.03.06.png
Capture d’écran 2019-09-17 à 14.03.06.png (100.89 KiB) Viewed 2253 times
Capture d’écran 2019-09-17 à 14.06.24.png
Capture d’écran 2019-09-17 à 14.06.24.png (204.94 KiB) Viewed 2253 times

Post by Animal »

Baselines don't change. They are a snapshot of the state of a project at time point.

What programmatic action do you do which you hope ends up with the TaskStore informing listeners that a Task has changed?

Post by Animal »

We could make it so that the
setBaseline(index)
method in the
TaskStore
fired a
'baselineSet', { index }
event.

Would that allow you to hook into the part of the lifecycle that you want to use?

Post by Animal »


Post by SIM-LTD »

Hi,

We know perfectly what is a baseline and moreover what this is about (just to remind you we were the first to inform you that this was crucial features that were missing when you launched the Gantt JS in April)...

The point is when you apply the baseline (thanks to you we have an array) to get as you said
napshot of the state of a project at time point.
; Then the baseline has to be recorded in the database! In order to be displayed back when reloading the Gantt.

This baseline can change, meaning that the snapshot can be different in the course of the project.

Thus, our question was simple :

If any changes of the Gantt Task (Date / Name / PercentDone ....) can be listened to, why when it comes to baselines updates it is not possible to monitor the changes.

Of course, we can and know programmatically when the user applies for a new baseline. But we wanted to take advantage of the main listener "gantt.taskStore.on" to catch all changes from the TaskStore.

Then is it possible to listen to changes on Baseline?

Post by SIM-LTD »

Hi

Sorry for the late answer.

Yes indeed, we need the baselines to be fired.

To be completely honest with you (as we do). We had faced a very odd issue (please look at the screenshot you'll understand).
This issue occurs whenever we run the command "gantt.taskStore.setBaseline(index)".
Then as we could not figure out why such of a very odd issue; we then decided to implement our own "setBaseLine" programmatically; where we simply loop inside the TaskStore and set the appropriate baseline according to the index passes.

In conclusion, our request was to know, when we run that process to set the baseline, in the taskStore, if it was possible to get known about the changes in the taskStore, when the baselines are updated; using simply the listener like this :
            gantt.taskStore.on({
                change : myGanttOnTaskChange,
            });
But unfortunately, the changes that are made in the baselines, are not fired, the way we thought.
This is why we wanted to know if there is a way to include in your cycle hook the baselines to be fired.

Then, it seems that what you are suggesting
I have created a feature Request: New #9252
could meet our requirement.

Thank you for your patience and for having taken into account this new request.

IE:
In case you have any idea about the crash that happens every time the method "setBaseline()" is ran, just let us know.
Attachments
Capture d’écran 2019-09-16 à 13.31.27.png
Capture d’écran 2019-09-16 à 13.31.27.png (64.52 KiB) Viewed 2247 times

Post by Animal »

Does your Task class have a custom toJSON implementation.

Because that's how fields which are objects (like a baseline's task) are tested for equality when going through the set process.

By default toJSON returns the original data loaded from the server, so that can't have circles.

Post by SIM-LTD »

Hi

Indeed we have a special class that converts a Flat Record (from SQL) to Hierarchical Record in order to match the natural Gantt Model.
But this is not a custom toJSON implementation. We do not use JSON at all but we access data directly from SQL database.
This work perfectly allowing us to store in SQL database any Gantt and have real-time data management...anyway...
We've been able to use and apply most of all features the Gantt.modules.js offers. The only issue is when we want to apply a baseline via the method "setBaseline()", there is that crash. So we have created our own setBaseline has described above, so that we can run SLQ update for each baseline updated.

When we'll have more time, we'll try to dig out from your notes posted above and give you our feedback.

Thank you again

Post by Animal »

OK, there is a bug when comparing record fields which themselves are records which can throw that error. This will be fixed: https://app.assembla.com/spaces/bryntum/tickets/9257-uncaught-typeerror--converting-circular-structure-to-json-when-comparing-two-rec

Post by SIM-LTD »

Hi

Great.... we thank you very much; because we were not able to give any full test case on that issue, and nonetheless, you have taken some of your time to check if there is a potential issue; that you just highlighted.

Once the fix is done (even in nightlies build), please let us know, so that we can give a try.

Many thank again

Post Reply