Re: [REACT] Remove block screen on sync
I believe you're looking for https://bryntum.com/products/gantt/docs/api/Core/mixin/Events#function-suspendEvents
I believe you're looking for https://bryntum.com/products/gantt/docs/api/Core/mixin/Events#function-suspendEvents
No, I mean: when I change color with CSS
const taskDom = gantt.getElementFromTaskRecord(task);
taskDom.style.backgroundColor = "grey";
This action fire sync event. Please share me sample code that disabled sync event after change background color?
I see no sync
event triggered when I changed backgroundColor
using the code you provided.
I tried here https://bryntum.com/products/gantt/examples/advanced/
I added sync url and enabled autoSync
, but still I don't see any events.
What's your gantt.project.changes
object contains after you changed the background?
Please apply required changes to one of our examples to make possible reproduce the issue and attach code here. it will help us to assist you with this question.
Yes, change background color not triggered sync. But when set readOnly for task it fired sync event.
task.readOnly = true;
Hello,
readOnly
is the regular taskRecord's field. Any change of task record will initiate sync, if autoSync
enabled.
To ignore changes for readOnly
field, you could configure the taskModel and set https://bryntum.com/products/gantt/docs/api/Core/data/field/DataField#config-persist to false
Thanks, please share me the way to configure the taskModel to archive this. I've taskModel as below
class MyTaskModel extends TaskModel {
static get fields() {
return [
{ name : 'durationUnit', defaultValue : 'hour' }
];
}
}
Here is the code
class MyTaskModel extends TaskModel {
static get fields() {
return [
{ name : 'readOnly', persist : false }
];
}
}