Dataprocessor with Gantt v3

Hello,

I’ve updated my DHTMLxGantt v2 to v3 and I encounter a problem with task deletion and dataprocessor on V3.
When I click on the delete button of a task, the Gantt automatically send something like a dp.sendData()… This behaviour not occur in V2 : I have a custom button to “commit” all my changes (updates, deletions, etc).
Is it any way to avoid this dataprocessor autocommit on deletion ?

Regards,
Maxime

Hi,
we’ll check what has changed relatively to the data processor. I’ll give you an update later today

In addition to my previous question: If you can tell me how to force the DataProcessor to send the entire datas of a task when it’s deleted ?
For now (V2), I can only get the taskID and I want to use others (UI) properties of my task to execute the proper delete action in my DB.

Thanks.

As for row deleting - unfortunately it is by design. In moment of data saving task is already deleted and there is no way to get other info. On server side, if you know the task id you can fetch it from database before deleting and run any necessary logic.

Thank you Stanislav.
And what about my DataProcessor problem ?

Hi Aliaksandr,

I can’t use V3 for the moment, do you have more informations for me ?
Thanks.

Hi,
the final fix is still not done, but you can apply a patch that will probably fix the problem for your case.
The data send is triggered when gantt batch deletes the links related to the task that has been deleted, seems like this is the only place where the sendData is called explicitly.
github.com/DHTMLX/gantt/blob/v3 … t.js#L5337

You can redefine this method in your code (so it will overwrite the original one) and remove data sending there. Probably this will fix the problem:[code]gantt._deleteRelatedLinks = function(links, silent){
var use_dp = (this._dp && !silent);
if (use_dp){
this._dp.setUpdateMode(“off”);
}
for(var i =0; i < links.length; i++){
if (use_dp) {
this._dp.setGanttMode(“links”);
this._dp.setUpdated(links[i],true,“deleted”);
}
this._deleteLink(links[i], true);
}

if(use_dp){
	//this._dp.sendData();
	this._dp.setUpdateMode("cell");
}

};[/code]

Hi Aliaksand,

Thanks a lot, your patch solved my problem !
Let me know when you release a new version.

Regards