Our state of the art Gantt chart


Post by arcady »

Do you use Crud Manager for data loading ?


Post by awakeb1 »

Yes


Post by arcady »

Importer does not use crud manager to load data because as I said before crud manager explicitly makes records non-dirty on load. It uses store.data = [...] assignment which does that thing.

So as I said you can use the same way Importer does ..meaning not using crud manager as well.

Theoretically crud manager can also use store.add([...]) to load records for that it should be configured to append records on load instead of bulk replacing them. In that cases the records will stay dirty.

It can be done when calling load method:

project.load({
    tasks        : { append : true },
    resource     : { append : true },
    assignment   : { append : true },
    calendars    : { append : true },
    dependencies : { append : true }
});

or configured right in the server response:

{
    "tasks" : {
        "append" : true,
        "rows" : [
            ...
        ]
    },
    ...
}

Then you will have to remove existing records yourself before adding them (since you turned to use append instead of replace). Something like this:

project.on('beforeLoadApply', () => {
    project.dependencyStore.removeAll()
    project.assignmentStore.removeAll()
    project.resourceStore.removeAll()
    project.taskStore.removeAll()
    project.calendarStore.removeAll()
})

Post by awakeb1 »

Thanks


Post Reply