| Issue 1181: | Change display options after initialization | |
| 4 people starred this issue and may be notified of changes. | Back to list |
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 11, 2011
Alright, well my question/request stands, then.
Feb 8, 2012
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
(No comment was entered for this change.)
Status:
Duplicate
Mergedinto: 293
Dec 3, 2014
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
@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 |
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(); } }