Our pure JavaScript Scheduler component


Post by Lars »

In my init function I'm creating the scheduler before I fire off an async method to fetch data. At this point the resources are in place, and the async function retrieves the event.

But I'm having some problem adding it, do I need to refresh the scheduler after I added a event? I tried that too :-)
scheduler.events.appendChild({
                        resourceId: ...,
                        resourceType: 1,
                        startDate: new Date(...),
                        endDate: new Date(...),
                        draggable: false,
                        resizable: true,
                        eventColor: '#CC85FF',
                    });
scheduler.refreshRows();
Any hints? The events are not showing.

Post by pmiklashevich »

Please see data property on the store.
scheduler.eventStore.data = []
P.S. No need to refresh. Should be done automatically based on changes in the store.

Pavlo Miklashevych
Sr. Frontend Developer


Post by mats »

Hi Lars,

Seems your trial license expired long ago. To continue using our product (and to get our support) please arrange proper licensing, contact sales@bryntum.com.

Post by Lars »

mats wrote: Mon Jun 24, 2019 3:31 pm Hi Lars,

Seems your trial license expired long ago. To continue using our product (and to get our support) please arrange proper licensing, contact sales@bryntum.com.
The sales team can check their mail.
pmiklashevich wrote: Mon Jun 24, 2019 2:59 pm Please see data property on the store.
scheduler.eventStore.data = []
P.S. No need to refresh. Should be done automatically based on changes in the store.
I'm not using eventstore, just the events (scheduler.events, https://www.bryntum.com/docs/scheduler/#Scheduler/view/Scheduler#property-events). I understand there is a difference?

If i first do a scheduler.eventStore.data = [], then I kan add data by pushing?
                    scheduler.eventStore.data.push({
                        resourceId: ...
                        resourceType: 1,
                        startDate: new Date(...),
                        endDate: new Date(...),
                        draggable: false,
                        resizable: true,
                        eventColor: '#0085CC',
                    });
(I've tried, nothing shows). Can I continue using events?

Post by pmiklashevich »

scheduler.events is a predefined dataset to be used with the eventStore which will get created automatically, if no event store is specified.

eventStore.data is a raw data to load initially if specified as a config. Also if you set something to eventStore.data = [...arrayOfNewData] as to a property, it will replace the whole dataset with the new one. That is the proper way to load data initially after an Ajax request.

To add/remove tasks please use proper API methods. For example for adding new tasks please call eventStore.add(...) method. If you're are working with tree store, please see treeNode mixin and store.rootNode.appendChild(...) method.

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply