Our pure JavaScript Scheduler component


Post by pbecker »

Hello,

A bit of background:

We are building an app where you drag a task from a Brytum Grid and drop it on scheduler for assignment. We have two views a user can use to display the Bryntum Grid (Tasks), which are separate Angular components. They are backed by the same data, but presented in a different way. A user can swap back and forth between these views whenever they like. We are destroying the Grid component that is no longer displayed when a user changes views.

I would like to implement a CRUD Manager and register the GridStore, EventStore, and ResourceStore to it so it can manage the AssignmentStore automatically.

So my questions are:

1) Is there documentation explaining exactly how to implement a CRUD Manager and register the GridStore, EventStore, and ResourceStore to it so it can manage the AssignmentStore automatically?

2) Is there documentation explaining how to define the Primary Key on the Resource record, so the AssignmentStore can store it correctly?

3) Is there a way, with our implementation (outlined above) that we could swap out Grid components easily? These two grids are backed by the same data, and we want the same records displayed in the same sorted order in both views.

4) Can we dynamically change the 'load' url in the CRUD Manager? We need to include some query string params.

5) How can we instruct the CRUD Manager to query new data? We intend to sync after each valid drop event, but external params can be changed at any time and we will need to re-fetch when that happens.


Post by marcio »

Hello pbecker,

Answering your questions

1) Yes, we have the documentation and a guide for CRUD manager available, please check https://www.bryntum.com/docs/scheduler-pro/guide/Scheduler/data/crud_manager and https://www.bryntum.com/docs/scheduler-pro/api/Scheduler/data/CrudManager

2) You can define the idField, but you'll need to create a custom class based on the ResourceModel, check this guide https://www.bryntum.com/docs/scheduler-pro/guide/Core/advanced/classes
https://www.bryntum.com/docs/scheduler-pro/api/Core/data/Model#property-idField-static

3) Yes, you can have two grids sharing the same stores (data layer) and having different views (UI layer), you can check one example here https://www.bryntum.com/examples/examples-scheduler/drag-between-schedulers/

4) We have a property to include query string params https://www.bryntum.com/docs/scheduler-pro/api/Core/data/AjaxStore#config-params and you can have more information here https://www.bryntum.com/docs/scheduler-pro/api/Core/data/AjaxStore and here https://www.bryntum.com/docs/scheduler-pro/api/Scheduler/data/CrudManager#ajax-request-configuration

5) You can set up autoSync to true to automatically triggers everytime a monitored store gets updated https://www.bryntum.com/docs/scheduler-pro/api/Scheduler/data/CrudManager#config-autoSync and also calling sync function when you need https://www.bryntum.com/docs/scheduler-pro/api/Scheduler/data/CrudManager#function-sync

Best regards,
Márcio


Post Reply