Is there a way to undo/redo the sorting of gantt columns?
Support Forum
Is there any sample code on how to store activities for stm tracker, i have to achieve this for zoom in/zoom out too?
Also i am trying to set one field manually in gantt and looks like sync doesn't trigger. It was working before version 4.1.0.
const me = this;
me.project.taskStore.allRecords.forEach(function (task) {
if(task.get('typeOfTask') == 'Project')
{
task.set(task.data.name, "testing");
}
console.log(task);
});
me.editorContext && me.gantt.features.cellEdit.finishEditing(me.editorContext);
me.project.sync().catch(() => {});
Can you please have a look and let me know if i need to do anything else to make it work. Is there any changes in code to trigger sync?
Is there any sample code on how to store activities for stm tracker, i have to achieve this for zoom in/zoom out too?
Sure, have you seen this demo of undo? https://www.bryntum.com/examples/gantt/undoredo/ it shows the STM log which you can save somewhere.
Also i am trying to set one field manually in gantt and looks like sync doesn't trigger. It was working before version 4.1.0.
Hard to say what's going on, if you can produce a small test case we can take a look!
I am expecting to trigger sync as i have altered the data, just adding the code from above comment
const me = this;
me.project.taskStore.allRecords.forEach(function (task) {
if(task.get('typeOfTask') == 'Project')
{
task.set(task.data.name, "testing");
}
console.log(task);
});
me.editorContext && me.gantt.features.cellEdit.finishEditing(me.editorContext);
me.project.sync().catch(() => {});
Can you please try below code in your php example, i have save enabled by default and wants to trigger sync
onSaveClick() {
const me = this;
// finish editing before changes persisting
me.project.taskStore.allRecords.forEach(function (task) { //modify project record each time on save
task.data.name = task.data.name+" test";
task.set(task.data.name, task.data.name+" test");//Appended a space at end of task name
});
me.editorContext && me.gantt.features.cellEdit.finishEditing(me.editorContext);
me.project.sync().catch(() => {
// error handling should go here
});
}
Changing data
property does not trigger anything, the explanation is here https://localhost/bryntum-suite/Gantt/docs/#Gantt/model/TaskModel#function-setData
The above is only to understand; do NOT use setData method.
Try the following:
me.project.taskStore.allRecords.forEach(function (task) { //modify project record each time on save
task.name = task.name + " test";
});