Our blazing fast Grid component built with pure JavaScript


Post by tjmeal »

Dear all i am using a Scheduler with Unplanned Grid similar to https://bryntum.com/products/scheduler/examples/drag-from-grid-custom/ but i have confused a little bit with the following.

1) Scheduler object > holds a Project object correct ?

Based on the following code i assume that when i use project.eventStore.chain() returns a store

    const chainedStore = grid.store = project.eventStore.chain(
      (eventRecord) => !eventRecord.assignments.length, undefined, {
      }
    );

3) Please check the screenshot and let me know all these 3 grid.store, scheduler.eventStore, scheduler.project.eventStore > pointing to the same seventStore2 is the same store?

4) if what i am saying at 3 is correct > when i want to add a new event to the Scheduler > which of those 3 should i use ? or it doesn't matter ? (Because i have tested it and it works correctly with all of them)

Thanks a lot in advance and i am waiting your reply.

Attachments
Screenshot 2025-10-31 at 15.42.46.png
Screenshot 2025-10-31 at 15.42.46.png (108.3 KiB) Viewed 2308 times

Post by marcio »

Hey tjmeal,

Thanks for reaching out.

Short answers:

1) Yes, SchedulerPro uses a Project (scheduler.project).
3) project.eventStore.chain(...) returns a new chained Store (a filtered/view store). So your chainedStore (grid.store) is a different Store instance. scheduler.eventStore and scheduler.project.eventStore are the same base EventStore instance; grid.store is the chained view that shares the same records but is a separate Store.
4) You can add via any of them, but I recommend adding to the base store (project.eventStore or scheduler.eventStore) so the scheduling engine / CrudManager observes the change consistently. After adding, await project.commitAsync() to ensure engine calculations finish.

Documentation reference: ProjectModel and EventStore.

Best regards,
Márcio

How to ask for help? Please read our Support Policy


Post by tjmeal »

Thanks a lot for your reply,

I have the following issue now (i am using ws but it dont matter for the case) i have the following code to create a record. As you see i am adding a record and then commitAsync() > my problem is that after commitAsync() > there are still active changes on the project.

Since i am commitAsync is the expected behaviour to have an empty scheduler.project.changes or not? My thinking is since, i am commitAsync() the project.changes should be empty. Also if you see the screenshot > the record still has a phantomID > the record is created i think phantomID should have been removed.

Please confirm with me the expected behaviour so i can investigate further.

        case 'CREATE': {
          const newEvents = data.transfers.map(detail => {
            return me.convertRequestResponse(detail);
          });
          console.log("1", newEvents);
          console.log("2", scheduler.eventStore.changes)
          scheduler.eventStore.add(newEvents);
          await scheduler.project.commitAsync();
          console.log("3", scheduler.project.changes?.events.added)

      Toast.show(`New Requests "${data.transfers.map(rec => rec.id).join(', ')}"`);
      break;
    }
Attachments
Screenshot 2025-11-06 at 09.19.03.png
Screenshot 2025-11-06 at 09.19.03.png (1.17 MiB) Viewed 1680 times

Post by mats »

Most likely the response from your server is wrong, the project instance hence cannot clear changes. Did you study our data integration guides in our docs?


Post by tjmeal »

i am not using AjaxStore or CRUDManager which in that case, i should map the phandom id with server id, if that is what you asking.

1) I created a button which statically creates and adds a record to the grid and again after commitAsync the changes are still there > can you spot any issue on that ?

2) Is the any debug monitoring when calling commitAsync() to show the error why its not actually committing ?

Attachments
Screen Recording 2025-11-07 at 00.51.47.mov
(9.14 MiB) Downloaded 74 times
Last edited by tjmeal on Fri Nov 07, 2025 1:09 am, edited 1 time in total.

Post by tjmeal »

Follow up context >

If you see on the video > when a record is added to the scheduler > call commitAsync() > and then call revertChanges the record is removed from the grid.

Which means that commitAsync() is not taken into account, since its completely remove the record from the store.

I also used a timeout and after 5 second the changes are still there. So the record is added the scheduler by on uncommitted status permanently (or until reload the page).

Attachments
Screen Recording 2025-11-07 at 01.06.26.mov
(27.93 MiB) Downloaded 72 times

Post by marcio »

Hey tjmeal,

As Mats mentioned, we have a guide explaining how to replace the phantomId with a proper ID value, which makes that record of the changes field disappear when committing/replacing the ID correctly.

Please see https://bryntum.com/products/schedulerpro/docs/guide/SchedulerPro/data/crud_manager_in_depth#saving-data.

Best regards,
Márcio

How to ask for help? Please read our Support Policy


Post Reply