Hi
I have an issue with the gantt segment: after dropping the segment into the new position the segment shrinks, its end becoming equal to the start.
I am importing the DHTMLX Gantt into a JHipster application.
In the controller i’m configuring the gantt:
configGantt() {
gantt.config.scale_unit = "day";
gantt.config.subscales = [
{ unit:"minute", step:30, date:"%H:%i"}
];
gantt.config.scale_height = 54;
gantt.config.xml_date = "%Y-%m-%d %H:%i";
gantt.config.columns = [
{name:"text", label:"Task name", tree:true, width:'*' }
];
gantt.config.sort = true;
gantt.init(this.ganttContainer.nativeElement);
}
This is the function from the controller that parses the data from the server into the gantt format:
generateGanttDataFromServerGanttModels() {
let data = [];
for (let i = 0; i < this.ganttModels.length; i++) {
let model: IGanttModel = this.ganttModels[i];
var start = null;
if (model.startDate != null) {
var startLong = (new Date(model.startDate.toString())).getTime();
start = new Date(startLong);
}
var end = null;
if (model.endDate != null) {
var endLong = (new Date(model.endDate.toString())).getTime();
end = new Date(endLong);
}
var modelAsData = {
id: model.id,
text: model.text,
start_date: start,
end_date: end,
parent: model.parentId
};
data.push(modelAsData);
}
gantt.clearAll();
gantt.parse({data});
}
Do you have any advice on how to fix this problem?
Thanks