We have using the bryntum gantt but the baselines for MPP import doesn't work for us. We have picked the code from following example but it work with start/end date of task not with baseline.
Looks like the problem in data format. taskRecord.baselines is an array of https://bryntum.com/docs/gantt/#Gantt/model/Baseline records.
That won't be easy to use it with your data format and requires in overriding of private methods. We do not recommend to rely on private methods in your solutions since we can change them without any notification.
The easiest way is to prepare your data to correct format after you got the response and before you apply it.
I cannot understand what you suggest because we did not create any new date format.
We are using the same data format from the JSON that we collected using Brynthum.
1) I upload an MPP
2) I use Brynthum to get a JSON file
3) I update the same JSON with new dates, using its original data format
4) I want to upload back this JSON to Brynthum and I want to see that the Baseline can be displayed.
So, I do not understand when you say we need to change the date format. Please explain.
But anyway this is not a core code, so feel free to make local implementation. As I said, only thing you need is to convert baseline fields to separate record:
processTask(data) {
const
me = this,
{ id, children } = data;
delete data.children;
delete data.id;
delete data.milestone;
if ('baselineStartDate' in data && 'baselineEndDate' in data) {
data.baselines = [{ startDate : data.baselineStartDate, endDate : data.baselineEndDate }];
delete data.baselineStartDate;
delete data.baselineEndDate;
}
data.calendar = me.calendarMap[data.calendar];
const t = new me.taskStore.modelClass(data);
if (children) {
t.appendChild(me.getTaskTree(children));
}
t._id = id;
me.taskMap[t._id] = t;
return t;
}