Skip to content Skip to sidebar Skip to footer

How Can I Save Tasks In Dhtmlx Gantt?

I used dhtmlx for chart gantt, I succeed in saving tasks in the data base, the problem is that when I add a new task there is no change in the chart, for example if I add a new ta

Solution 1:

Try returning 'true' from onLightboxSave handler http://docs.dhtmlx.com/gantt/api__gantt_onlightboxsave_event.html

If you return 'false' or 'undefined' (as in your case), the form stays opened and the form values are not applied to the client-side.

Returning 'true' will save values and close the form, so you won't need to call hideLightbox manually

gantt.attachEvent("onLightboxSave", function(id, task, is_new){
   var dateToStr = gantt.date.date_to_str("%d-%m-%Y");

   $.post("Control",{
      id:task.id,
      duration:task.duration,
      text:task.text,
      start_date:dateToStr(task.start_date)
   },function(data){
      alert(data);
   }) ;

   returntrue;
});

Post a Comment for "How Can I Save Tasks In Dhtmlx Gantt?"