Error on task drop or splitted tasks

Hi,

I’ve some trouble with the drop functionnality. When I drop a task wich start at 0h, it switch to 1h.
I saw that this bug is fixed in the last release, but another bug appeared in this last release…
In my gantt I have splitted tasks, they are not displayed in your last released.

Here is my code :

gantt.templates.task_text = function(start, end, ATask){
	var sHTML;
	sHTML = '';
	if (!ATask.split){
		if (ATask.bTask || ATask.bTR){
			sPercentage = Math.round(ATask.progress*100);
			if (sPercentage != "NaN")
				sHTML = "<span class='cl_span_progress'>"+sPercentage+ "% </span>";
		}
	} else {
		for(var i =0; i< ATask.split.length; ++i) {
			rTask = ATask.split[i];
			bDelay = false;
			sStart_Index = rTask[0];
			sEnd_Index = rTask[1];
			sStatus = rTask[2];
			sDelay = rTask[3];
			ID_Object = rTask[4];
			iType = rTask[5];
			if (sDelay == "1")
				bDelay = true;
				
			sClass = Get_Legend_CSS_Class(sStatus,bDelay,iType);
			sLeft = CVal(sStart_Index,ATask.duration_fictive);
			
			sWidth = CVal(sEnd_Index-sStart_Index,ATask.duration_fictive);
			sHTML = sHTML + "<div  id=\"test"+i+"\" class='gantt_task_line "+sClass+"' style='height:20px;left:"+sLeft+"%; width:"+sWidth+"%;'> </div>";
		}
		
	}
	return sHTML;
}

function CVal(AValue, ADuration) {
	return AValue * 100 / (ADuration);	
}

function Get_Legend_CSS_Class(AStatus,ADelay,AElement_Type){
	switch (AStatus){
		case "8":
			if (ADelay)
				return "cl_rsEarly_booking cl_rsDelay";
			else
				return "cl_rsEarly_booking";
		break;
		case "7":
			if (ADelay)
				return "cl_rsMaintenance cl_rsDelay";
			else
				return "cl_rsMaintenance";
		break;
		case "6":
			return "cl_rsAnomaly";
		break;
		case "5":
			if (ADelay)
				return "cl_rsOverload cl_rsDelay";
			else
				return "cl_rsOverload";
		break;
		case "4":
			if (ADelay)
				return "cl_rsTerminated cl_rsDelay";
			else
				return "cl_rsTerminated";
		break;
		case "3":
			if (ADelay)
				return "cl_rsInProgress cl_rsDelay";
			else
				return "cl_rsInProgress";
		break;
		case "2":
			if (ADelay)
				return "cl_rsFullyPlanned cl_rsDelay";
			else
				return "cl_rsFullyPlanned";
		break;
		case "1":
			if (ADelay)
				return "cl_rsNotFullyPlanned cl_rsDelay";
			else
				return "cl_rsNotFullyPlanned";
		break;
	}
}

Here are my data :

data = {"data":[
  {"id":"0_0", "id_object":"25406", "text":"Active and capa", "delay":false , "priority":"2", "open": false, "icon":"212", "split":[[0,2,"4","0",27680,"1"],[12.25,13.8333333333333,"2","0",27697,"1"]], "bTask":false, "duration_fictive":"13.8333333333358", "bEquipment":true},
  {"id":"0_0_5","id_object":"27680", "text":"test 1", "delay":false , "start_date":"05/17/2014 01:00:00", "duration":"2", "priority":"4", "progress":"1", "parent":"0_0", "icon":"226", "bTask":true, "bTR":false, "bEdit":true},
  {"id":"0_0_6","id_object":"27697", "text":"test JBR 2", "delay":false , "start_date":"05/29/2014 07:00:00", "duration":"1.58333333333333", "priority":"2", "progress":"0", "parent":"0_0", "icon":"226", "bTask":true, "bTR":false, "bEdit":true}
]} 

Splitted tasks displayed:

Splitted tasks not displayed:

Is there a way to fixe the bug of hours in my previous release, or fixe the bug of splitted tasks in the last release ?

Thanks.

Hi,
I can not reproduce the problem locally, can you attach a complete example?

BTW, instead of specifying relative (in percents) size of the splits, you can calculate the width in pixels as a diff between start and end dates of the child task. Check this method:
docs.dhtmlx.com/gantt/api__gantt … mdate.html