Hi,
I have the strange problem and i don’t have idea.
If add task in date 2014-03-30 or 2014-03-31, my browser crash. I have no problem if add task after o before with two dates.
Here is my code:
gantt.config.duration_unit = 60*60*1000;
gantt.config.duration_step = 1;
gantt.config.xml_date = "%Y-%m-%d %H:%i:%s";
gantt.config.scale_unit = "day";
gantt.config.step = 1;
gantt.config.date_scale = "%d %M";
gantt.config.subscales = [
{unit:"hour", step:1, date:"%H:%i"}
];
gantt.templates.scale_cell_class = function(date){
if(date.getDay()==0||date.getDay()==6){
return "weekend";
}
};
gantt.templates.task_cell_class = function(item,date){
if(date.getDay()==0||date.getDay()==6){
return "weekend"
}
};
gantt.config.lightbox.sections = [
{name:"id_abaco", height:22, map_to:"id_abaco", type:"select", options: [
{key:<?=$_REQUEST['id_abaco']?>, label: "<?=$_REQUEST['id_abaco']?>"}
]},
{name:"id_operaio", height:22, map_to:"id_operaio", type:"select", options: [
<?=$operai_gantt?>
]},
{name:"id_mezzo", height:22, map_to:"id_mezzo", type:"select", options: [
<?=$mezzi_gantt?>
]},
{name:"id_attrezzatura", height:22, map_to:"id_attrezzatura", type:"select", options: [
<?=$attrezzatura_gantt?>
]},
{name: "description", height: 70, map_to: "text", type: "textarea", focus: true},
{name: "n_pezzi", height: 40, map_to: "n_pezzi", type: "textarea"},
{name: "valore_unitario", height: 40, map_to: "valore_unitario", type: "textarea"},
{name: "time", height: 80, type: "duration", map_to: "auto", time_format:["%d", "%m", "%Y", "%H:%i"]}
];
gantt.locale.labels.section_id_abaco = "ID Abaco";
gantt.locale.labels.section_id_operaio = "Collaboratore";
gantt.locale.labels.section_id_mezzo = "Mezzo";
gantt.locale.labels.section_id_attrezzatura = "Attrezzatura";
gantt.locale.labels.section_valore_unitario = "Valore UN";
gantt.locale.labels.section_n_pezzi = "N Pezzi";
gantt.config.columns=[
{name:"text", label:"Task name", tree:true, width:'250px' },
{name:"n_pezzi", label:"N Pezzi", align:'center' },
{name:"valore_unitario", label:"Valore UN", align:'center' },
{name:"start_date", label:"Start time", align: "center" },
{name:"duration", label:"Duration", align: "center" },
{name:"id_operaio", label:"Collaboratore", align: "center" },
{name:"id_mezzo", label:"Mezzo", align: "center" },
{name:"id_attrezzatura", label:"Attr.", align: "center" },
{name:"add", label:"" }
];
gantt.config.grid_width = 750;
gantt.config.date_grid = "%d/%m/%y";
gantt.config.min_column_width = 40;
gantt.templates.progress_text = function(start, end, task){
return "<span style='text-align:left;'>"+Math.round(task.progress*100)+ "% </span>";
};
gantt.config.order_branch = true;
gantt.init("gantt_here");
gantt.load("gantt/common/connector.php");
var dp = new dataProcessor("gantt/common/connector.php");
dp.defineAction("error",function(sid,response){
//var message = response.getAttribute("message");
alert("Il collaboratore selezionato è già impegnato nell'arco di tempo selezionato per questo task");
return false;// return false to cancel default data processing at all
})
dp.init(gantt);
What’s happened? Thanks for reply