Our pure JavaScript Scheduler component


Post by mats »

@mos It seems this is caused by you using both single assignment (resourceId on your events) as well as assignmentStore data. If you remove all the 'resourceId' entries from your events, it should work (worked fine for me).

In order to understand your code a bit better, can you please share details of what the purpose is with using the task editor like that? As I read it, you load all events into a grid when editing/creating an event?


Post by mos »

@mats

As I read it, you load all events into a grid when editing/creating an event?

Partially.

Displayed events are typically related by a parent (which isn't shown on the scheduler).
The intent is to display related events in the taskeditor grid when a specific item is selected, and to give users the ability to edit multiple related items from the editor grid.

I do use eventstore records to initiate a new store for the grid via beforeTaskEditShow . I subsequently filter the store to display only related events (snippet below).

May I clarify your response? Since the intent is to present events on the grid, I'd imagine I needed to preserve resourceId's.
Would appropriate handling be to create a new store (non-eventStore) using the same the same raw data used to initialize eventStore?

Thanks Mats!

Code snippet (in taskHandler.js)
Note: The added/clarified filter here is ".filter(r => r.parentEventId== contextParentId)".

let eventStoreData = event.source.eventStore.records;

let gridStore = new Store({
        data: eventStoreData.filter(r => r.parentEventId== contextParentId),
        id: "reservationGridStore"
    });

Post by johan.isaksson »

Hi,

You should not need to include resourceId, nor load the records manually into another store. Instead I recommend chaining the event store, https://bryntum.com/products/scheduler/docs/api/Core/data/Store#function-chain. Something like this:

const gridStore = scheduler.eventStore.chain(r => r.parentEventId === contextParentId);
Best regards,
Johan Isaksson

Post Reply