DHTMLX/Gantt-Need clarification on Client Side Rendering!

Hi Guys!

First of all i would like to thank DHTML Team for this awesome product! You guys are doing great! Thanks.!

I need a help!

Based on this docs.dhtmlx.com/gantt/desktop__server_side.html

I can able to get the data from the Server using this gantt.load(“apiUrl”); ! That is really cool.

But I wants to process the data coming from the server before loading it into gantt, in the Client Side!

How to do that!?

Hi,
you can use onTaskLoading event, it will be called for every task being loaded into the gantt:
docs.dhtmlx.com/gantt/api__gant … event.html
There is also onLinkLoading event for every loaded link, it has evaded our documentation somehow

[code]gantt.attachEvent(“onTaskLoading”, function(task){
// preprocess task
return true|false;
});

gantt.attachEvent(“onLinkLoading”, function(link){
// preprocess link
return true|false;
});[/code]

If you want a complete server response object - currently there is no appropriate api event, but you can load data via xhr manually, preprocess it and then parse into gantt:

$.ajax({ url: "/ganttData", success: function (result) { gantt.parse(result, "json"); } });
docs.dhtmlx.com/gantt/api__gantt_parse.html