Our state of the art Gantt chart


Post by y0u1me2 »

Hi!
I got trouble while using and customizing gantt.
So I wanna ask you something. (gantt version : 5.0.3)

1.
Input:

tasks
[
  { 
     "name"        : "task1",
     "startDate" : "2022-01-01",
     "endDate"  : "2022-01-11",
     "duration"  : "10"
  },
 {  
"name" : "task2", "startDate" : "2022-01-01", "endDate" : "2022-01-21", "duration" : "20" } ] interval { "startDate" : "2022-01-05", "endDate" : "2022-01-06", "isWorking" : false }

Response (displays on gantt):
interval → 2022-01-05 (grey shading on gantt)
task1 → 2022-01-01 ~ 2022-01-12 (duration : 10)
task2 → 2022-01-01 ~ 2022-01-22 (duration : 20)

What I want:
changed json data comparing input/output
task1 → endDate : 2022-01-12
task2 → endDate : 2022-01-22

When the gantt is loaded, it doesn't auto-sync.
even though I set auto-sync option true in the constructor of ProjectModel.
If I want to get back changes from gantt, what kind of method should I call?

2.
When I tried to indent a task which has predecessors, 'Scheduling cycle' popup shows.
And I want to customize this popup, but I don't know what to do.

https://bryntum.com/examples/gantt/conflicts/

What I want:
remove second item (Deactivate depedency) on the popup
and show only two items (Remove dependency & Cancel the change and do nothing)

Thanks in advance.


Post by alex.l »

Hi y0u1me2,

  1. You need to set this config https://bryntum.com/docs/gantt/api/Gantt/model/ProjectModel#config-silenceInitialCommit

    Silences propagations caused by the project loading.

Applying the loaded data to the project occurs in two basic stages:

  1. Data gets into the engine graph which triggers changes propagation
  2. The changes caused by the propagation get written to related stores
    Setting this flag to true makes the component perform step 2 silently without triggering events causing reactions on those changes (like sending changes back to the server if autoSync is enabled) and keeping stores in unmodified state.

This is safe if the loaded data is consistent so propagation doesn't really do any adjustments. By default the system treats the data as consistent so this option is true.

new Gantt({
    project : {
        // We want scheduling engine to recalculate the data properly
        // so then we could save it back to the server
        silenceInitialCommit : false,
        ...
    }
    ...
})

[/quote]

  1. Not supported yet, please check a workaround here: https://forum.bryntum.com/viewtopic.php?f=51&t=20874&p=103444

And here is a feature request to add this functionality https://github.com/bryntum/support/issues/4460

All the best,
Alex


Post by y0u1me2 »

Thank you for reply Alex,
I have additional questions

1) In case that I set config (silenceInitialCommit = false),
it seems that gantt returns full data (such as calendars, whole tasks).
is it possible to commit only for changes?

input: the server data (back-end server transmit when gantt is being loaded)
output: gantt-calculated data
changes: differences comparing input and output

for example,
task 1 : 2022-01-01 ~ 2022-01-10
task 2 : 2022-01-01 ~ 2022-01-20
task 3 : 2022-01-11 ~ 2022-01-20
interval : 2022-01-02 ~ 2022-01-03

changes (= the data what I want to get back)
task 1 : 2022-01-01 ~ 2022-01-11 (endDate changed)
task 2 : 2022-01-01 ~ 2022-01-21 (endDate changed)

2) I tried the solution arcady suggested here (https://forum.bryntum.com/viewtopic.php?f=51&t=20874&p=103444)
but the result was : checkbox was just disabled on the popup.
what I want : checkbox and sentence not shown on the popup.

Is this kind of customization not supported yet (impossible) ?

Thanks in advance.


Post by alex.l »

I cannot reproduce the problem described in #1. I see only updated: [] arrays sent back to server, not all data. Btw, you will have a lot of data only after first recalculation before you save that data. Next time your server will have correct (scheduled) dataset and initial commit won't be big or there is will be nothing to commit at all.

#2. Yes correct, because you set deactivateCheckbox.disabled = true;. To hide it, try to set hidden property.

Please, always open a new thread for every new question. Our forums rule: one thread - one question.

Thank you.

All the best,
Alex


Post Reply