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

Implementing a navigator in a Resource View

Asked by Thomas Dumont-Goyette
1 year ago.

I've implement a navigator in my Resource View and the problem is that it will change the date (startDate) but not the visibleStart and the visibleEnd. Here some picture to show you this.

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

The visibleStart() and visibleEnd() are guaranteed to work only for the following viewTypes:

"Day"
"Week"
"WorkWeek"

The primary purpose of these methods is to provide information on the dates that were calculated automatically. In case of the "Resources" view, columns are set manually and each column can display an arbitrary date. So it assumes you know which dates the calendar displays.

Anyway, the latest sandbox build (8.3.2790) now tries to calculate visibleStart() and visibleEnd() for resources view as well by going through all columns. visibleStart() will return the min date, visibleEnd() will return the max date + 1.

https://javascript.daypilot.org/sandbox/

Just note that it's necessary to call update() after changing startDate (which is used as the default column date) before visibleStart() and visibleEnd() will use the updated value.

Comment posted by Thomas Dumont-Goyette
1 year ago.

Ok but the Resource view will not show the event if the start and end is not in the current day. For exemple if i navigate to April 3, I will get my event and give it to the view but they won't appear, to make them appear I need to change their start and end to the date of today.

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