I'am evaluating the Gantt product as newcomer and would like to know if it is possible to get all fields of the UPDATED Task in the sync operation. Docs say it's possible but I can't get it to work.
In the first SYNC operation (it creates new Task) the request is ok, but when I update the new one created only the id and name fields are present.
Please have a look at my code, very similar to the Advanced demo, in Angular.
HTML
<bry-gantt
#gantt
[height]="heightDiv"
[columns]="ganttConfig.columns"
[project]="ganttConfig.project"
[viewPreset]="ganttConfig.viewPreset"
[rowHeight]="ganttConfig.rowHeight"
[barMargin]="ganttConfig.barMargin"
[stripe]="ganttConfig.features.stripe"
[taskEdit] = "ganttConfig.features.taskEdit"
[startDate]="ganttConfig.startDate"
[endDate]="ganttConfig.endDate"
(onGanttEvents)="onGanttEvents($event)"
></bry-gantt>
ngOnInit
this.ganttConfig.project.load({}).then(data => {
const stm = this.ganttConfig.project.stm;
this.ganttConfig.project.on('schedulingconflict', context => {
Toast.show('Scheduling conflict has happened ..recent changes were reverted');
context.continueWithResolutionResult(EffectResolutionResult.Cancel);
});
Toast.show('All fine...');
stm.enable();
stm.autoRecord = true;
}).catch(response => {
// show notification with error message
Toast.show(response && response.message || 'Unknown error occurred');
});
const project = new ProjectModel({
transport: {
load: {
url: 'assets/gantt-data-new.json'
},
sync: {
requestConfig: {
url: '/api/projects/syncgantt',
headers: {
'Authorization': 'Bearer token***',
'Content-Type' : 'application/json; charset=utf-8'
}
}
}
},
phantomIdField:'sysPhantomId',
autoLoad: false,
autoSync: true,
writeAllFields : true
});
export default {
columns: [
{ type: 'wbs', width: 60 },
{ type: 'name', field: 'name', text: 'Name', width: 250 },
{ type: 'startdate' },
{ type: 'duration' },
{ type: 'percentdone', width: 70 }
],
rowHeight: 50,
barMargin: 7,
viewPreset: 'weekAndMonth',
startDate : new Date(2020,3,1),
endDate : new Date(2020, 3, 6),
features: {
stripe: true,
timeRanges : {
showHeaderElements : true,
showCurrentTimeLine : true
}
},
project
}
Can you please help on that?
Thank you
Matteo