Issue 291: optimize gotoDate to skip redrawing when possible
Status:  Released
Owner: ----
Closed:  Aug 2013
Reported by jagthedr...@gmail.com, Jan 13, 2010
It would be nice to be able to call the 'gotoDate' function with an extra 
parameter to indicate to fullCalendar that it should skip redrawing.  
Here's where I've run into it:

I have a dayClick event that looks like this:

dayClick : function(date,allDay, jsEvent, view){
 jQuery('#calendar').fullCalendar('gotoDate', date);
}

The purpose of that code is to make fullCalendar track what day the person 
is interested in so that switching between views will always show them the 
day that they want.  However, calling the 'gotoDate' function causes the 
agenda views to redraw.  So if someone is looking at the 'agendaWeek' view 
and has scrolled down to the evening hours, then clicks on the calendar, 
the view resets back up to the morning hours.  

Just altering the 'gotoDate' function to take a second parameter that 
indicates the date requested is already in view would probably work.

So if you wanted the current behavior you call it like normal, if you want 
to suppress the redraw you could call like this:

var skipRedraw = true;
jQuery('#calendar').fullCalendar('gotoDate', date, skipRedraw);

Thanks,
Jeremy

Jan 13, 2010
#1 travisco...@gmail.com
Love this idea.  the less we re-render the events, the better.
Jan 13, 2010
#2 jagthedr...@gmail.com
I've just committed some code to GitHub for this.  My branch is here:

http://github.com/jagthedrummer/fullcalendar

I've added a 'selectDate' function that works exactly like 'gotoDate' except it does 
not call 'render'.  In fact 'selectDate' is the old 'gotoDate' code without the call 
to 'render()', and 'gotoDate' now calls 'selectDate' then 'render'.

Thanks,
Jeremy

Jan 19, 2010
Project Member #3 adamrs...@gmail.com
hi travis & jeremy,

i like this idea and agree, gotoDate should not redraw if it doesn't need to

but instead of making a separate method, i need to think, would we *ever* want
gotoDate to redraw if it doesn't need to? id say no

so i would just consider the current implementation of gotoDate to be in need of an
optimization.

do you guys agree? if so, jeremy, i can handle this if you'd like, but can't say when
i'd release it (have many other things), so you should go ahead if you'd like. would
probably just be a matter of changing 219 in main.js to look at the view's visStart
and visEnd
Summary: optimize gotoDate to skip redrawing when possible
Status: Accepted
Jan 20, 2010
#4 jagthedr...@gmail.com
Hey Adam, I think you're absolutely right in thinking that the calendar should handle this 
transparently.  I've taken your suggestion and added a check to make sure that the new date 
is outside of view.visStart and view.visEnd before rendering events.  

My feature branch for this is here:
http://github.com/jagthedrummer/fullcalendar/tree/skip-redraw-if-possible

I'll be sending a pull request momentarily.

Thanks,
Jeremy
Feb 5, 2010
Project Member #5 adamrs...@gmail.com
thanks jeremy, this is in 1.4.4. realize i was wrong and had to change the comparison 
from visStart/visEnd to just start/end. things work great
Status: Fixed
Aug 13, 2013
Project Member #6 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Implemented
Aug 13, 2013
Project Member #7 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Released