Our state of the art Gantt chart


Post by JBO »

Hello,

since Gantt version 1.2.0 the ProjectModel does not implement GanttCrudManager anymore. This seems to make sense, because the project data should be seperated from the crud logic in my opinion.

However, at the moment my config only contains a ProjectModel
const myProject = new ProjectModel({
    transport      : {
        load : {
            url       : 'php/load.php',
        },
        sync : {
            url : 'php/sync.php'
        }
    }
});
Firstly, i am a bit confused how ProjectModel can still be initialized with a transport and why it still loads my data without implementing CrudManager.
And secondly i was explicitly triggering reloads (autoLoad = false) using myProject.load(), which is not a function anymore.

Do i have to add a CrudManager object to my config now, in order to call load? How would i do that?
None of the examples seem to explicitly trigger load() nor do more with the crudManager than adding a transport to their ProjectModel.


Thank you for your help!

Also: To which Change Log Item does this change correlate?

Post by mats »

It still implements GanttCrudManager as far as I can see:
export default class ProjectModel extends GanttCrudManager(BuildMinimalGanttProject(Model)) {

Post by JBO »

Thank you for your reply Mats.

Maybe i am importing the wrong class then. But my ProjectModel lost the load function with 1.2.0.

I am looking at gantt.umd.d.ts here.
V1.1.5 export class ProjectModel extends TaskModel implements GanttCrudManager {...
V1.2.0 export class ProjectModel extends TaskModel {...

Or maybe the way i coded this is not correct.
What i did was:
import { ProjectModel} from 'bryntum-gantt/gantt.umd.js';
const myProject = new ProjectModel(...);
myProject.load();
Which worked perfectly for me until version 1.2.0. Now i get a compilor error, that says "load() does not exist on type ProjectModel". How can i implement explicit loading?

Post by JBO »

An answer would still be appreciated.

Post by saki »

Do you develop for Angular? I'm only guessing because you mention gantt.umd.d.ts what is type definition file for typescript.
gantt.umd.d.ts is the file generated from documentation in source files.

The real source (Gantt/lib/Gantt/model/ProjectModel.js) reads:
export default class ProjectModel extends GanttCrudManager(BuildMinimalGanttProject(Model)) {
what implies that the crud manager functionality is still there.

It is possible that we have a bug in the gantt.umd.d.ts generator and I'm opening ticket for that.

https://github.com/bryntum/support/issues/67

Meanwhile, try to use the following as a workaround:
// @ts-ignore
myProject.load();

Post by JBO »

Yes i develop in Angular.
The code works again with ts-ignore.

Thank you for the support!

Post by saki »

FYI: this issue has been fixed. The typings have been updated so the necessity to force TypeScript to ignore some lines with // ts-ignore should be minimal.

Post Reply