Our pure JavaScript Scheduler component


Post by Exigo »

Hello,

We recently tried out the beta build for the Scheduler PRO.. However it seems that the way that the classes are made has changed, atleast alot of errors was presented when extending the classes for the event stores and resource stores.

Since I guess the docs have not been updated yet, due this being the beta build I would just like to ask, how we are expected to extend classes in the future?

This the exnteding class

location model.png
location model.png (28.86 KiB) Viewed 647 times

and the error that is presented, in the code that was working prior to the update

Error.png
Error.png (55.61 KiB) Viewed 647 times

Post by arcady »

Which method do you call? I don't see because of the tooltip.


Post by Exigo »

Hello,

It is just a simple instantiation..

location.service code.png
location.service code.png (67.2 KiB) Viewed 631 times

Post by arcady »

I can't reproduce that.
Yet there is an example called tasks located in examples-scheduler/angular/tasks folder. It demonstrates extending of standard ResourceModel class. I think if you follow that approach there won't be that type error:

export type AppResourceModelConfig = ResourceModelConfig & {
    color: string;
}

export class AppResourceModel extends SchedulerResourceModel {

    color: string;

    constructor(config?: Partial<AppResourceModelConfig>) {
        super(config);    
    }

    static get fields() {
        return [
            { name : 'color', defaultValue : 'blue' }
        ];
    }
}

So following that approach should fix unknown scheduleId error:

export class BryntumLocation extend ResourceModel {
    scheduleId : number;

    constructor(config?: Partial<BryntumLocation>) {
        super(config);    
    }

    ...
}

Can you please try and let us know if that works for you? If it doesn't please provide a short test case so we could investigate the issue deeper. Thank you for the feedback!


Post Reply