Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance when there are thousands of events - load events via ajax? #31

Closed
herbdool opened this issue Sep 5, 2023 · 2 comments · Fixed by #34
Closed

Improve performance when there are thousands of events - load events via ajax? #31

herbdool opened this issue Sep 5, 2023 · 2 comments · Fixed by #34
Labels
type - feature request New feature or request

Comments

@herbdool
Copy link

herbdool commented Sep 5, 2023

I'm testing this out with an existing client site that has over 6500 events over quite a few years. This views plugin loads all events at once in order to render the calendar. Perhaps there's a way to page the content loading with AJAX. It might require a pager that can page by date.

@herbdool herbdool added the type - feature request New feature or request label Sep 5, 2023
@indigoxela
Copy link
Member

indigoxela commented Sep 6, 2023

Perhaps there's a way to page the content loading with AJAX

In fact, there is. A bit "hidden", as it works with exposed filters. The GET params Fullcalendar (always) sends are "start" and "end". And if your view uses these key(s), the filtering should work.

Need to elaborate a real example for that.

Edit: oops, I mixed that up with "fullcalendar feed", which does exactly that.

@indigoxela
Copy link
Member

indigoxela commented Sep 6, 2023

@herbdool your request makes sense. In order to get this working, we'd only need to allow empty calendars to render. That's not hard.

Then you'd add a "Fullcalendar feed" (Fullcalendar JSON), configure your fields, and add an exposed filter to that json view for start and end.
Important step: set the "Filter identifier" to exactly "start" and "end", as that's how fc sends the GET requests.
Add the path of this "Fullcalendar feed" to the calendar view (page) under "Additional event source URLs".

You won't see form items in the preview, of course, but you can see them in action on your json path:

On /fullcalendar-feed-test.json (replace with your actual path), you'll get a lot of records. Now filter with URL params like /fullcalendar-feed-test.json?start=2023-09-01&end=2023-10-01.

Please note that the views preview was broken, but is now fixed (different issue).
To be able to render the empty calendar you'll need this PR here: #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type - feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants