Our pure JavaScript Scheduler component


Post by sactory »

Initial I set below, it's seem ok.

const eventStoreData = [...]; // Array
const resourceStoreData = [...]; // Array
scheduler.eventStore.data = eventStoreData;
scheduler.resourceStore.data = resourceStoreData;

When I doing some task, I need to reset data with:

const newEventStoreData = [...]; // Array
const newResourceStoreData = [...]; // Array
scheduler.eventStore.data = newEventStoreData;
scheduler.resourceStore.data = newResourceStoreData;

After data reset with that code, it's seem ok, but when I drag/drop it show error:

scheduler.module.js:19392 Uncaught (in promise) Error: Attempt to set item scheduler-a._.465-577-x to already existing member's id scheduler-a._.465-576-x
    at Bag.changeId (scheduler.module.js:19392)
    at HorizontalEventMapper.updateElementId (scheduler.module.js:109648)
    at eval (scheduler.module.js:95496)
    at Array.forEach (<anonymous>)
    at eval (scheduler.module.js:95451)
    at Array.forEach (<anonymous>)
    at EventDrag.updateRecordsSingleAssignmentMode (scheduler.module.js:95423)
    at EventDrag.updateRecords (scheduler.module.js:95367)
    at EventDrag.finalize (scheduler.module.js:93873)
    at EventDrag.onDrop (scheduler.module.js:93758)
changeId @ scheduler.module.js:19392
updateElementId @ scheduler.module.js:109648
eval @ scheduler.module.js:95496
eval @ scheduler.module.js:95451
updateRecordsSingleAssignmentMode @ scheduler.module.js:95423
updateRecords @ scheduler.module.js:95367
finalize @ scheduler.module.js:93873
onDrop @ scheduler.module.js:93758
trigger @ scheduler.module.js:3662
finishTranslateDrag @ scheduler.module.js:47979
onMouseUp @ scheduler.module.js:48785
handler @ scheduler.module.js:12068

Drag/drop behavior:
Drag/drop from position A to B -> it's seem ok -> reset data store -> it's seem ok.
Then continue to drag/drop from position B to A -> it's show error.

If I refresh browser every thing reload, it's ok.


Post by mats »

Could you please give us a test case?


Post by sactory »

mats wrote: Thu Sep 10, 2020 1:36 pm

Could you please give us a test case?

Drag/drop from position A to B -> (success) reset data store with new data, it's seem ok.
Then continue to drag/drop from position B to A, it's show error.
My code reset data store:

scheduler.eventStore.data = newEventStoreData;

Post by pmiklashevich »

Hello?

Could you please try to reproduce the issue with one of our demos? Please open this link and run in console: https://www.bryntum.com/examples/scheduler/vue/javascript/advanced/dist/index.html#/

scheduler = bryntum.query('scheduler')
scheduler.resourceStore.data = [{"id": "r1", "name": "Red"}]
scheduler.eventStore.data = [{
                "resourceId": "r1",
                "startDate" : "2017-01-01T10:00:00",
                "endDate"   : "2017-01-01T12:00:00",
                "eventStyle": "plain",
                "eventColor" : "red"
            }]

Then drag the task one hour ahead. Then run in console:

scheduler.resourceStore.data = [{"id": "r1", "name": "Red"}]
scheduler.eventStore.data = [{
                "resourceId": "r1",
                "startDate" : "2017-01-01T10:00:00",
                "endDate"   : "2017-01-01T12:00:00",
                "eventStyle": "plain",
                "eventColor" : "red"
            }]

Then drag the task one hour ahead again. Please see there is no errors.

To create a testcase, please apply minimal changes to one of our demos, to start receiving the same error you see in your application. As soon as you get it, please zip it up and send it to us, so we can inspect the issue.

Best regards,
Pavel

Attachments
Запись активности на экране 2020-09-14 в 10.41.54.gif
Запись активности на экране 2020-09-14 в 10.41.54.gif (3.68 MiB) Viewed 1270 times

Pavlo Miklashevych
Sr. Frontend Developer


Post by sactory »

Hi support team,

I just successfully reproduced this bug on sample code.

I believe this bug is caused by these specific conditions:

  • multiEventSelection: true
  • maintainSelectionOnDatasetChange: true
  • events has id
  • events data was replace by a new array instance

Step to reproduce:

  • Step1: open scheduler
  • Step2: select an event
  • Step3: do something that will cause events data to be replace by a new array instance: e.g: this.events = [...someArrayData];
  • Step4: drag selected event from step 2 to a new resource
  • Step5: drag the same selected event somewhere else

I attached here screen capture and sample code.

Thank you.

Attachments
Screen Recording Ghost Duplicate Event.zip
(3.6 MiB) Downloaded 80 times
Source-Ghost Duplicate Event.zip
(11.13 MiB) Downloaded 127 times

Post by pmiklashevich »

The issue is fixed in the upcoming 4.0 release. Could you please download 4.0 beta from the Customer Zone and confirm it works for you there?

Pavlo Miklashevych
Sr. Frontend Developer


Post by sactory »

Thank you for your support.

I tried version 4.0 beta and it seems indeed resolve this issue.

Could you tell me when will the official 4.0 version be released?

FYI just an heads up that there is an issue I encountered, the storeEvent.update listeners seems to have extras event compare to 3.1.9, I got events coming with property 'changes.duration' that I didn't see before when I initialize events for Scheduler, maybe this is intentional?


Post by mats »

4.0 GA should be available in the next two weeks.

FYI just an heads up that there is an issue I encountered, the storeEvent.update listeners seems to have extras event compare to 3.1.9, I got events coming with property 'changes.duration' that I didn't see before when I initialize events for Scheduler, maybe this is intentional?

Please start a thread for each question you have.


Post Reply