Premium support for our pure JavaScript UI components


Post by Shinya Umeshita »

Hi all,

I'm trying the schedluer with the dependencies of type "start to start".
The problem I'm facing is that the events are being aligned vertivally.
Once the schedule is loaded on the page, I can move the events,
but the events are not being placed where I hope to be at the point when the page is loaded.
How should I give the datas, to make events placed as the event's start and date is set?
FYI, wanted.png is the image of what I want to do.
and current.png is what is currently shown on the screen.

data (1).js includes the data in this implementation.

thanks.

Attachments
wanted.png
wanted.png (247.44 KiB) Viewed 934 times
current.png
current.png (245.37 KiB) Viewed 934 times
data (1).js
(19.7 KiB) Downloaded 69 times

Post by alex.l »

Gantt is using a scheduling Engine, so you have to have reasons why the task cannot be done as soon as possible. Try to set "lag" or use manually scheduled tasks.

Attachments
Screenshot 2021-12-09 at 14.33.16.png
Screenshot 2021-12-09 at 14.33.16.png (26.22 KiB) Viewed 921 times

All the best,
Alex


Post by Shinya Umeshita »

Hi alex,

Thanks for the reply.
I have tried setting the lag, and was able to move the event to where I have expected.
What I am having trouble with now, is that I can't move the event towards the from-event more than the amount of lag.
Is there a way to change lag after the scheduler have been created?


Post by alex.l »

You can change a lag using TaskEditor. Double-click on the event, goto Predecessors/Successors tab, see "Lag" column.

All the best,
Alex


Post by Shinya Umeshita »

Thank you for the reply alex.

I understood how to change the lag from screen.
However, this time I would like to change lag by program (in source code).

I found setLag in DependencyBaseModel.
https://www.bryntum.com/docs/scheduler-pro/api/Scheduler/model/DependencyBaseModel#function-setLag
Can I use it to change the lag programmatically, or is there any other way to change lag?

What I want to do is to change start and end datetime earlier than initial shown data.
(I attached the GIF - cannot set to earlier)

Attachments
ganttdepend2.gif
ganttdepend2.gif (750.59 KiB) Viewed 848 times

Post by alex.l »

lag is just a field of DependencyModel. Try gantt.dependencyStore.getAt(3).lag = 10

Take a look at this guide too: https://bryntum.com/docs/scheduler-pro/guide/engine/schedulerpro_events_scheduling
You may find some helpful information.

All the best,
Alex


Post by Shinya Umeshita »

Hi Alex,

thank you for the other day.

I have tried "gantt.dependencyStore.getAt(3).lag = 10", that you have told me, and was able to reassign the lag to the dependency I wanted to.
But now, I am facing a problem that the event that I have moved goes back to where it used to be for a moment, then goes to where I have dragged to. The reassigning of the lag is done to the dependency which has the event moved in it. I am assuming that the event is going back when the reassigning of the lag is happening.
Though, I am not sure of it, so I want to know the cause of the event going back, and a way to prevent this.

About the files are as below:
codeSample.js: The code that I have written. There are two separate parts included, but they are a part of a single js file. The value assigned (x.lag) is calculated beforehand, from the value of timeDiff(an amount that the event is dragged) which is given from the scheduler.
dependenciesData.json and eventsData.json: The data used in the scheduler. It is also used to calculate the lag to assign.

Many thanks.

Attachments
eventsData.json
(3.66 KiB) Downloaded 68 times
dependenciesData.json
(1.07 KiB) Downloaded 63 times
codeSample.js
(6.43 KiB) Downloaded 69 times
Last edited by Shinya Umeshita on Thu Jan 13, 2022 3:52 am, edited 1 time in total.

Post by alex.l »

Hi Shinya Umeshita,

As I see on your screenshot, you have "start-to-start" dependency with the task above. So, your bottom task will be scheduled according to startDate of its predecessor (top task).
It is not possible to edit all constraints using drag-n-drop, because it's not predictable what exactly do you expect to see when you already have some constraints, it should be done with TaskEditor. lag may have negative value, try it. Also please check if you have constraintDate value for your task, as example, it may have a "start no earlier than" constraint date after your d-n-d actions. The field to edit it is placed on Advanced tab.

I recommend you to read our guide to full understanding of scheduling process https://bryntum.com/docs/scheduler-pro/guide/engine/schedulerpro_events_scheduling

All the best,
Alex


Post Reply