i am using dhtmlx:gantt and dhtmlx:gantt-data for Meteor 1.4.1.2
everything from the example coding is working:
gantt.init(“gantt_here”);
gantt.meteor({tasks: TasksCollection, links: LinksCollection});
now i want to manipulate the data before the gantt gets rendered.
i found the events onBeforeGanttRender and onTaskLoading which naming sounds suitable but i think there were not fired in my case?
can anyone explain me which events are available when i am using gantt.meteor ?
is there another way of integration for the meteor framework which is less tight but still reactive but does not miss the events?
is there any other of manipulating the task data?
for example i want to read the color associated to a user and color all of his tasks in his color.
i could neither find any detailed doku on google nor any sample coding.
which events are available when i am using gantt.meteor ?
All events are available, but gantt add’s item one by one, using gantt.addTask API, so instead of onTaskLoading you have the onBeforeTaskAdd event.
thank you very much for your help. I reverted my code to use the event: onBeforeTaskAdd
within i have a lookup function for the color which corresponds to the task owner.
(the task does not have an explicit color, it is derived from the owner)
the disadvantage is that, the added color attribute triggers immediate an update to the associated collection.
the update then triggers an update of the gantt
is it possible to control the fields which trigger an update of the collection (at the moment every field gets automatic synced)
is there an alternative way to to color the task without css (because the color comes from the database but from the user collection)
for the task-owner i used gantt.templates.rightside_text to return the username after lookup the referenced userId.
maybe my strategy is to complicated and you can give me another hint.
The data syncing will be triggered if you are using API to update item objects. ( updateTask for example )
You can update task silently by setting properties directly on the task object.
var task = gantt.getItem(id);
task.color = "red";
gantt.render();
thanks for your reply. I could not find a function getItem but getTask did it for me. I applied this code and changed the color with a double lookup of the owner of a task and the color of this owner.