question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Callback when a view's type or dates change (viewChange?)

See original GitHub issue

The viewRender callback is called every time a view’s DOM is rendered/rerendered. It gets fired on a view’s initial render, but it also gets fired when a dynamic options change occurs that requires a view rerender. Or potentially for other reasons.

However, there is no callback that gets fired exclusively when there is a view-switch or the date-range change.

A common usecase: want to do post-processing on the DOM of the fc-title element at the top of the calendar, which is dependent on the date range but independent of the view.

Potential names for this callback: viewChange ?

Question: what if the view’s type changes (ex: agenda->basic), but the date range does not. should it still fire?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:26
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
arshawcommented, Jun 16, 2020

In the v5 release candidate this is called datesSet

4reactions
mirlannurcommented, Jan 24, 2021

In the v5 release candidate this is called datesSet

datesSet callback is not working in my case.

<script>
import FullCalendar from '@fullcalendar/vue'
import dayGridPlugin from '@fullcalendar/daygrid'
import timeGridPlugin from '@fullcalendar/timegrid'
import interactionPlugin from '@fullcalendar/interaction'
export default {
  components: {
    FullCalendar,
  },
  data: function() {
    return {
      calendarOptions: {
        //...
            headerToolbar: {
              left: "prev,today,next",
              center: "",
             right: "dayGridMonth,timeGridWeek,timeGridDay",
            },
            datesSet: this.handleDatesSet,
        //...
      }
    },
  methods: {
    handleDatesSet(dateInfo){
       console.log("handleDatesSet handled");
    },
  },
</script>
<template>
      <FullCalendar ref="fullCalendar"
        class='demo-app-calendar'
        :options='calendarOptions' 
      >
        <template v-slot:eventContent='arg'>
          <b>{{ arg.timeText }}</b>
          <i>{{ arg.event.title }}</i>
        </template>
      </FullCalendar>
</template>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Callback before calendar view is changed - Stack Overflow
Triggered when a new date-range is rendered, or when the view type switches. function( view, element ) view is the View Object for...
Read more >
changeView - Docs v3 - FullCalendar
If you are using Custom View, you can change the visibleRange in the same way: $('#calendar').fullCalendar('changeView' ...
Read more >
Angular Change Detection - How Does It Really Work?
Change detection works by detecting common browser events like mouse clicks, HTTP requests, and other types of events, and deciding if the view...
Read more >
Map Class - Bing Maps - Microsoft Learn
This method takes in callback function and passes a session ID to it which can ... viewchange, Occurs for every frame of a...
Read more >
Client Side Active View Change - ASP.NET AJAX ... - Demos
To perform this, the code uses the ASPxScheduler client-side API. When a view type is selected in the drop-down list, the SetActiveViewType client-side...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found