I'm currently trying to implement the angular scheduler.
There was an issue I ran into when I wanted to work with a custom idField and childrenField.
I based myself on this example:
https://www.bryntum.com/examples/scheduler/tree/
I created a custom model 'FmResource':
class FmResource extends ResourceModel {
static get fields() {
return [
{
name: 'guid',
type: 'string'
},
{
name: 'url',
type: 'string'
}
];
}
}
(FmResource as any).exposeProperties();
FmResource.idField = 'guid';
FmResource.childrenField = 'url';
this.resourceStore = new ResourceStore({
tree: true,
autoLoad: true,
readUrl: 'init',
modelClass: FmResource,
});
Uncaught (in promise): TypeError: Class constructor FmResource cannot be invoked without 'new'
TypeError: Class constructor FmResource cannot be invoked without 'new'.
So I have 2 questions:
- Is this the right approach to use a custom idField and childrenField?
- How can I resolve this error?
Thanks in advance!