My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 1181: Change display options after initialization
4 people starred this issue and may be notified of changes. Back to list
Status:  Duplicate
Merged:  issue 293
Owner:  ----
Closed:  Aug 2013


Sign in to add a comment
 
Reported by m...@davidhedlund.se, Nov 14, 2011
Is there a setter for the options object after the calendar has been rendered?

For instance, if I want to change firstDay from Sunday to Monday, I might want to do something like this:

$('#cal').fullCalendar('option', 'firstDay', 1);

... but I haven't been able to get that working. Would I have to destroy/reinit to be able to update the current view? Because that would require me to keep track of all state variables, such as current view, current date range, current selection, as well as having to re-fetch all events. Which seems a bit messy...
Dec 9, 2011
#1 low...@schedulista.com
There is a setter, it works how you described. However it only lets you set height, contentHeight and aspectRatio

Here's the snippet of code in fullCalendar:
	function option(name, value) {
		if (value === undefined) {
			return options[name];
		}
		if (name == 'height' || name == 'contentHeight' || name == 'aspectRatio') {
			options[name] = value;
			updateSize();
		}
	}
Dec 11, 2011
#2 m...@davidhedlund.se
Alright, well my question/request stands, then.
Feb 8, 2012
#3 dave.ba...@gmail.com
I just changed the options function to add

else {
    options[name] = value;
    rerenderEvents();
}

I can change value of "editable" in my case on the calendar during runtime.
Aug 14, 2013
Project Member #5 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Duplicate
Mergedinto: 293
Dec 3, 2014
#6 Loren...@gmail.com
i had to add the same hack to change config on runtime, but in my case i wanted to change the title, which requires the view to be updated, therefore rerenderEvents was not enough

I added this : 

else {
   options[name] = value;
   var getCurrentViewName = currentView.name;
   currentView.name = "";
   renderView(0,getCurrentViewName);
}

it's either this or else force the view to go back and forth very quickly, but that seemed kind of dirty.

Do you think a proper fix could be done for the next update of fullcalendar?
Dec 14, 2014
Project Member #7 adamrs...@gmail.com
@LorenGRX, can you write your comment on  issue 293 . This specific issue has been closed and merged into that one.
Sign in to add a comment

Powered by Google Project Hosting