Hi team!
We've been using Bryntum Scheduler with great success so far in our project, but we're having a couple of weird cases we're not able to understand and hope you can shed some light into it.
Let's start with this one straight from the frameworks/angular/simpleeditor example, but with a little twist.
We've modified app.config.ts to have just these three resources:
const resources = [
new ResourceModel({
id : 1,
name : 'Alfonso'
}),
new ResourceModel({
id : 2,
name : 'Pepe'
}),
new ResourceModel({
id : 3,
name : 'Manue'
})
],
That works fine and displays them in the left margin of the scheduler. If we use this way of declaring events, as used in the example, events are being rendered and attached to their matching employees:
events = [
{
id : 1,
resourceId : 1,
startDate : new Date(2017, 0, 1, 10),
endDate : new Date(2017, 0, 1, 12),
name : 'First Task',
iconCls : 'b-fa b-fa-mouse-pointer'
},
{
id : 2,
resourceId : 2,
startDate : new Date(2017, 0, 1, 12),
endDate : new Date(2017, 0, 1, 13, 30),
name : 'Lunch Break',
iconCls : 'b-fa b-fa-arrows-alt'
}
]; // Works and attach events to resources
That's great, but if we try to declare the same events as an array of EventModel types instead of plain objects:
events = [
new EventModel({
id : 1,
resourceId : 1,
startDate : new Date(2017, 0, 1, 10),
endDate : new Date(2017, 0, 1, 12),
name : 'First Task',
iconCls : 'b-fa b-fa-mouse-pointer'
}),
new EventModel({
id : 2,
resourceId : 2,
startDate : new Date(2017, 0, 1, 12),
endDate : new Date(2017, 0, 1, 13, 30),
name : 'Lunch Break',
iconCls : 'b-fa b-fa-arrows-alt'
})
]; // Doesn't attach events to resources
The events are not attached to the resources:
Why is this happening? We couldn't find anything in the documentation that helps us understand why this second option is not displaying any event. Is there something we're doing wrong?
We've got a trickier issue related with this and we might open another post later, but we would love to understand this and get the basics right before digging into that
Thanks a lot!
Miguel.