search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

when change

Asked by wouter
2 years ago.

Hi Daypilot Form,
When i change on the fly the cellwidth,
some events disappear.
they are still visible in the _event object in Angular

i use the following code to adjust cellwidth:

this.scheduler.config.zoom = this.zoomlevel;
this.scheduler.control.update();

Answer posted by Dan Letecky [DayPilot]
2 years ago.

I recommend following the Angular Scheduler Zoom tutorial which includes a working Angular project where everything works fine:
https://code.daypilot.org/12302/angular-scheduler-zoom

In particular, you shouldn't mix the direct API and the config/events attributes (automatic change detection).

You can either invoke the change by modifying the config object:

this.config.zoom = 1;

This will reload the Scheduler with the new config, and use the events specified using the [events] attribute.

Calling update() will reload the Scheduler without reapplying changes from [config] and [events]:

this.scheduler.control.update();

The events can disappear if you load events using the direct API and then change the config object. By changing the config object you force it to reload the event data from the [events] attribute:

this.scheduler.control.update({events: [ /* ... */]});
this.config.zoom = 1;
Comment posted by Wouter
2 years ago.

Thanks for your response

I tried to solve it in the following way

When adding events I use the following code :
this.schedulerEvents = newEvents;

when adjusting zoom levels I use the following code:
this.scheduler.config.zoom

the problem seems to occur only with events that last only one day.

in the config the scale is set to "Day"

scale: 'Day'

Comment posted by Dan Letecky [DayPilot]
2 years ago.

Could you please post the data object of one of those events that disappear?

Comment posted by Wouter
2 years ago.

Thanks for your time,

In the attached link is the date that comes in the events

https://jsoneditoronline.org/#left=cloud.1c640033af0c4f5e878f40f263d5e22a

Comment posted by Dan Letecky [DayPilot]
2 years ago.

Thanks! The data seem to be fine.

Would you be able to modify the Zoom tutorial project (https://code.daypilot.org/12302/angular-scheduler-zoom) so that it reproduces the issue? Everything seems to be working fine for me.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.