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

Scheduler partial updates sometimes are not rendered

Asked by Aliaa
1 month ago.

Hi,

I have a problem with the scheduler that doesn’t happen all the time. When I make some update to one or multiple events using: dp.events.update(event) these updates are not rendered until I update the whole scheduler using dp.update()

I cannot always capture the scenario that causes this issue but one scenario I could catch is as follows:

  1. Create a new event

  2. Copy this new event using drag and drop from one cell to another (this is custom code) and for UI reasons we are creating a temporary event in place of the dragged event. (Check attached photo)

  3. After new event save, the original event is left in its original cell and the temporary event is removed.

  4. Using dp.events.remove(event) to remove the temporary event triggers this issue.

As a work-around for the above scenario I have to render the whole row using row.removeClass('x')

The work-around is working fine for this scenario but the problem is with other scenarios that I cannot capture.

Can you investigate this issue, please? Your help is highly appreciated.

Thanks,

Aliaa

Answer posted by Dan Letecky [DayPilot]
1 month ago.

It looks like you invoke the add/remove/update operations during drag and drop moving - but that’s not a supported scenario. It wasn’t designed to support them - it may work or not.

The problem is that removing an event may affect the whole row and other rows as well. All affected rows need to be updated. It also relies on the source event to stay there until the drag and drop is finished.

Comment posted by Aliaa
1 month ago.

Hi Dan,

Thanks for the reply.

I encountered the same issue with a different scenario that doesn’t include drag and drop. Simply by adding an event which it’s resource is not initially loaded. Or, updating an existing event and changing its resource to one that is not initially loaded.

I reload the resources in order for the new event to be displayed. I even tried reloading both resources and events from the server to render the whole scheduler but the same issue happens. Any update or delete to any event in the scheduler will be saved but will not be reflected in the scheduler UI. Any thoughts about how to fix this?

Comment posted by Dan Letecky [DayPilot]
1 month ago.

Hi Aliaa,

Thanks for the update.

If you reload the resources, the all events are reloaded as well so it should make no difference if you load the resources later. Anyway, if you are able to reproduce the problem, would you be able to create a sample project that shows the issue? You can generate a blank project using https://builder.daypilot.org/scheduler. Then you can send it to support@daypilot.org. Thanks!

Comment posted by Anonymous
1 month ago.

Hi Dan,

I will work on the sample project. But let me update you that the above scenario happens only when the resource to be added is added at the bottom of the scheduler. Meaning that the new row is added as the last row.

Comment posted by Dan Letecky [DayPilot]
1 month ago.

Thanks for the update. Are you adding the row using the rows.add() method?

Comment posted by Anonymous
1 month ago.

No, reloading the resources from the server:

dp.rows.load(url, successCallback, errorCallback);

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