fullCalendar (v5) callback/handler anytime view is rendered?
Asked Answered
B

1

7

What is the way to catch anytime a view is rendered?

Not only when switching views, but also when clicking today / prev / next?
I need to clear an array of unique event titles after (or before) each render is complete.

So, similar to eventAllRender which was removed starting v4.

Currently using .click event for all buttons, which does the trick, but I was hoping there was something really linked to the actual rendering.

calendar.render();

$('.fc-button').click( () => {
  console.log("do something")
})
Bly answered 7/7, 2020 at 19:26 Comment(0)
B
9

https://fullcalendar.io/docs/datesSet

Called after the calendar’s date range has been initially set or changed in some way and the DOM has been updated.

datesSet: function(info) {
  // ...
}
Bly answered 7/7, 2020 at 21:5 Comment(1)
thanks for this :) but be careful with datesSet, using Vue here and datesSet is called when calendar options (including events) changes and even if dates range has not change.Huambo

© 2022 - 2024 — McMap. All rights reserved.