Our pure JavaScript Scheduler component


Post by dev team »

v5.0.7

Hello,

Since the addition of the AssignmentStore, the drag Edit event is throwing a console error and the mouse down is stuck. (See attached)

viewtopic.php?p=107582&sid=ab043e2a5a540bd2ee5e3d690318f3c2#p107582

async function initialise(): Promise<void> {
  try {
    jobScheduler = new SchedulerPro({
      appendTo: 'scheduler-job-container',
      height: '90vh',

  startDate: new Date(2022, 6, 1),
  endDate: new Date(2022, 7, 1),

  //columns are for the left panel
  columns: [
    { text: 'Name', field: 'name', flex: 1 },
  ],
  project: await getProjectModel(),
});
  } catch (e) {
    console.error(e);
  }
}

async function getProjectModel(): Promise<ProjectModel> {
  const resourceStore: ResourceStore = await getResourceStore();
  const eventStore: EventStore = await getEventStore();
  const assignmentStore: AssignmentStore = await getAssignmentStore(eventStore);

  return new ProjectModel({
    //ResourceStore = Engineers + Teams
    resourceStore,

//EventStore = Jobs
eventStore,

//AssignmentStore = Engineer && Team Job Assignment
assignmentStore,
  });
}

async function getAssignmentStore(eventStore: EventStore): Promise<AssignmentStore> {
  let assignmentCollection: AssignmentModel[] = [];
  let events = eventStore.allRecords as JobEventModel[];

  for (let index = 0, resourceStoreLength = events.length; index < resourceStoreLength; index++) {
    assignmentCollection.push(
      new AssignmentModel({
        "id"       : (index + 1),
        "event"    : (events[index] as JobEventModel).id,
        "resource" : (events[index] as JobEventModel).engineerId,
      }));
  }

  return new AssignmentStore({
    data: assignmentCollection
  });
}
Attachments
Console error call stack
Console error call stack
Drag Event Console Error 2022-07-15 144722png.png (21.77 KiB) Viewed 729 times
Job Scheduler - Google Chrome 2022-07-15 14-45-30 Drag Event.mp4
Drag Event Issue
(19.44 MiB) Downloaded 41 times
Last edited by dev team on Mon Jul 18, 2022 9:33 am, edited 1 time in total.

Post by marcio »

Hey,

Thanks for the report. I reproduced that error in the sample that you shared in the other post. I created a ticket for it: https://github.com/bryntum/support/issues/4943

Best regards,
Márcio


Post by dev team »

Hello Marcio,

With reference to the following post: https://github.com/bryntum/support/issues/4943#issuecomment-1185793389

I do not feel these tickets are related as the following was resolved by Animal's suggestion in this forum post: viewtopic.php?f=44&t=21776

Thanks


Post by alex.l »

Thanks for your note, we will check how it's related.

All the best,
Alex


Post by dev team »

Hello Alex,

I was attempting to say that the tickets are not related.

The eventResize: true feature is still an issue in v5.1.0

I have attached a sample project where I have enabled eventResize: true and the console error is being thrown.

Thanks

Attachments
Bryntum_SchedulerPro_Sample.zip
Broken Example
(9.26 MiB) Downloaded 37 times

Post by alex.l »

Hi,

I was attempting to say that the tickets are not related.

Yes, I got your point and answered on GitHub where you already posted that.
Ticket is still opened and we will test that properly and fix. It's not 100% clear now if they are related or not (we have same error message in both cases), this is note for dev team to test both bugs at once while fixing and nothing else, so don't worry about that :)

All the best,
Alex


Post by dev team »

Hi Alex,

Has there been any progress with this ticket?

Thanks


Post by joakim.l »

Hi!

I have investigated this issue further and the problem has been fixed locally.
Until the fix is properly tested and released (most probably next patch release), you could use this workaround:

Instead of providing a AssignmentStore instance as this:

return new AssignmentStore({
   data: assignmentCollection
});

...provide a config object instead:

return {
   data: assignmentCollection
};

Regards
Joakim


Post Reply