Hello everybody,
currently i get performance problems on my Gantt Chart when i implement the following Code on my page
[code]gantt.attachEvent(“onTaskDrag”, function(id, mode, task, original, e){
var modes = gantt.config.drag_mode;
if(mode == modes.move){
var diff = task.start_date - original.start_date;
var childrens = gantt.getChildren(id);
for(var i = 0; i < childrens.length; i++)
{
var child = gantt.getTask(childrens[i]);
child.start_date = new Date(+child.start_date + diff);
child.end_date = new Date(+child.end_date + diff);
gantt.refreshData(child.id);
}
…[/code]
I know i can do that when i set the task type attribute at “project” but then is the parent task not moveable.
Before i paste this code in “onTaskDrag” Event i get a fast running program. Each task is moveable from date to date in milisecond response.
After i paste this code in “onTaskDrag” Event i get a slow running program. When i move the parent task i dont get a fast response on the gantt chart. If i wait two, three seconds after i moved the task, task jump then to the date where i moved before.
I have tried with eachTask function instead of for () loop or while loop with seperate counter…no improvement at performance.
I dont know why i get so a bad running system with this changes.
Can anyone help me?
Best regards
Axt