Our pure JavaScript Scheduler component


Post by jbrazier »

We are currently using the CrudManager on the SchedulerPro component and loading data via the loadCrudManagerData method.

We are not using the assignment store currently as all resourceIds are directly linked to the event.
e.g.
"events": {
"rows": [
{
"id": 1,
"name": "Event 1",
"startDate": "2022-01-01",
"endDate": "2022-01-05",
"resourceId": 1
}
]
}

But we've noticed that when you add a new event to the scheduler, either by double clicking or drag and drop, that the new event doesn't have a resourceId assigned to it.

The assignment store does have a record for that new event and the resource it's assigned to, so we're having to copy the resourceId from there as a workaround.

I've attached a video that demonstrates this behaviour and just wanted to confirm if this is a defect or is working as expected?

Thanks,

Jason

Attachments
AssignmentIssue_Trim.mp4
(1.53 MiB) Downloaded 25 times

Post by tasnim »

Hello,

I've tried to reproduce it with our online example. But It's working fine here. Could you please upload a runnable test case which we can run with npm start, reproduce and debug it?


Post by jbrazier »

Hi Tamsin,

No worries, I've attached a very simple Vue app - if you run this and click on the 'Click Me' button it will log to the console the event name and its resource ID.

Add a new event by double clicking and you should see that the new event has an undefined resource ID.

Cheers,

Jason

Attachments
demo.zip
(11.77 KiB) Downloaded 19 times

Post by jbrazier »

It's also worth noting that if I create the event in Row 1 and then move the new event into Row 2 then it does update the resourceId on that event correctly - it's only undefined when it's first created.


Post by marcio »

Hey jbrazier,

Thanks for the demo, I reproduced the issue and created a ticket to investigate/fix it https://github.com/bryntum/support/issues/6017

Best regards,
Márcio


Post by nickolay »

Hi jbrazier,

The issue should be resolved soon, one note is that you probably should explicitly enable the "single assignment" mode (and better to not use it at all, since its a legacy thing). This can be done with https://bryntum.com/products/schedulerpro/docs/api/Scheduler/data/mixin/SharedEventStoreMixin#config-singleAssignment config.

Right now, this mode is activated implicitly, by examining the data for events (presence of the resourceId field). But if some scheduler will have no events (lets say initially), this mode may not be activated.


Post by jbrazier »

Thanks for the prompt response Márcio.

And that's really useful to know Nickolay, I did try setting up the singleAssignment property as true as suggested but it still didn't seem to work in the scenario above.

const project = new ProjectModel({
  // This config enables response validation and dumping of found errors to the browser console.
  // It's meant to be used as a development stage helper only so please set it to false for production systems.
  validateResponse: true,

  eventStore: {
    singleAssignment: true,
  },
});
Attachments
support.PNG
support.PNG (4.8 KiB) Viewed 895 times

Post by marcio »

Hey jbrazier,

So for now you'll need to wait for the fix, you can track the progress by watching the GH ticket, and when it's tagged to resolved, you'll see which patch will be released with the fix. :)

Best regards,
Márcio


Post by nickolay »

@jbrazier Not following, on the screenshot it seems to be enabled?


Post by jbrazier »

Hi Nickolay, yeah it has enabled the setting, I was thinking that doing that would resolve the issue but I guess until the bug is fixed it still won't set the resourceId properly - but it's still good practice to do it.

It does raise the question for us as you mentioned this is legacy behaviour, so is your recommendation that we should really be using the assignment store to link events and resources, even if they're only ever going to be single assignments?


Post Reply