Premium support for our pure JavaScript UI components


Post by peterjc »

Hi, I am just updating the scheduler in an Angular (13) application from version 3.1.3 to 5.0.6.

I have installed the following

"@bryntum/scheduler": "^5.0.6",
"@bryntum/scheduler-angular": "^5.0.6",

and a just going though all the changes

Previously, and had extended the EventModel with my own class to add a few more fields

eg I have

import { EventModel } from '@bryntum/scheduler/scheduler.lite.umd.js';

export class SchedulerEventModel extends EventModel {

static get fields() {
    return [
      'localEdits',
      ... etc

And then I supply this when I instantiate the EventStore

 this.eventStore = new EventStore({
        modelClass: SchedulerEventModel,
        data: []
      });

However, I am now getting an error, and I just can't work out why..

2022-06-27_16-31-18.png
2022-06-27_16-31-18.png (24.21 KiB) Viewed 197 times

SchedulerEventModel is till derived from EventModel which form what I can see is what modelClass is expecting?

Any ideas what I could have wrong here?

Thanks in advance


Post by marcio »

Hey,

I reproduced the behavior that you described, and create a ticket to investigate what's causing that. https://github.com/bryntum/support/issues/4858

In the meantime, you could set the custom store like this

<bryntum-scheduler
    #scheduler 
    ...other configs
    [eventStore]        = "schedulerConfig.eventStore"
</bryntum-scheduler>

And in the schedulerConfig object, you can set the store to use your custom model like this:

export const schedulerConfig = {
    eventStore                : {
        modelClass : SchedulerEventModel
    }
    ... other Scheduler configuration
  
};

Thanks for the report.

Best regards,
Márcio


Post by peterjc »

Thankyou, the above work around seems to work fine!


Post Reply