I need to change the start data of my tasks/ activities.
Support Forum
Hey kamran_mushtaq,
You can use https://www.bryntum.com/docs/gantt/api/Gantt/model/TaskModel#function-setStartDate
Best regards,
Márcio
Hey Marcio,
thank you for the reply, however I'm unable to find how to use it I can see the reference you linked but please can you help me how to use this. I need the start date of my tasks flexible not fixed to some specific value (constraint). I don't want constraints in startDate. Can you please tell me with a code example.
Thank you
Hi kamran_mushtaq,
Please read this guide to understand how scheduling works and why startDate of regular task cannot be changed to random value https://bryntum.com/docs/gantt/guide/engine/gantt_events_scheduling
If you want to manually set dates for task, you can set https://bryntum.com/docs/gantt/api/Gantt/model/TaskModel#field-manuallyScheduled to true for that task.
Can you please let me know why I'm seeing this error in console? its from export
We need more context. It sounds like general JS error, maybe bacause of EcmaScript version you specified.
Check StackOverfow? https://stackoverflow.com/questions/38296667/getting-unexpected-token-export
It's sounds not relevant to original question, if you need further assistance with that, please make a new topic for this question and attach a runnable test case to reproduce this problem.
All the best,
Alex
Hi,
I found a way for you to achieve it. You could use taskStore's https://bryntum.com/docs/gantt/api/Gantt/data/TaskStore#function-forEach method and iterate through every item and set manuallyScheduled
to true
after the data loads (https://bryntum.com/docs/gantt/api/Gantt/model/ProjectModel#event-load)
Here is a sample code snippet for you
new Gantt({
...
project : {
...
listeners : {
load({ source : project }) {
project.taskStore.forEach((item) => {
item.manuallyScheduled = true;
};
}
}
}
});
All the best ,
Tasnim