Open EdCampion opened 3 years ago
I'm not sure what you mean with async, could you provide an example of how you are trying to use visibleRange
or why it doesn't work?
Hi, Perhaps I've fallen foul of the "just try it" dictum. So I've seen examples where visibleRange is provided a function. The function immediately returns a range object. My scenario would be something like the following, and would work like the events or resource fetching does.
initialView: 'timeGrid',
visibleRange: function(currentDate) {
//ajaxRequest to api providing ranges
//onSuccess of request
//notify FullCalendar of ranges via callback similar to how events and resources work.
}
});
In that case, you could do your own ajax call, then on success, update the range using setOption
.
Thanks for that. This works for the initial load. I'm aware this is not a support avenue. But will chance my arm anyway. I'm trying to roll my own next/previous functionality. As it stands, my next and previous buttons advance / retreat the current window and then call the api to fetch the range for the chosen window. On API success I update the visible range option. My new problem is that this does not trigger a fetch of events. It dosen't make sense to me to call the fullcalendar next() / previous() functions. But maybe I'm confused.
@EdCampion would you mind to share your progress on this, if there was more? I'm doing a custom one (quarterList). What I found hard to understand is how the "currentDate" provided in their dateRange callback is supposed to be used. I assume that if the dateRange is calculated based on the "currentDate" the NEXT/PREV actions would auto-magically work, but now I'm not so sure anymore...
Checklist
Feature Description
I'm working on a schedule feature using a custom view and the resourceTimeline plugin. It is essentially a timesheet which has arbitrary date ranges. I need to fetch the ranges via API, they are not known / computable.
I need something like the existing visibleRange option, but I need the ability to use it in an async fashion.