| Issue 293: | Setters for all options | |
| 59 people starred this issue and may be notified of changes. | Back to list |
Is there an easy way to set timeSlot property when fullcalendar is already in use? I have different types of users in the drop-down list and each of them have different settings (like timeSlot). After selecting one of users I'd like to load calendar again with custom timeSlot property. I know Adam introduced this featured in last released, but it only works for apsectRatio, contentHeight and height. I need to setup timeSlot as well. I'm on the deadline... Has anybody any clue how to resolve this issue? Adam: is there any way to include this in the next release? Thanks again for your great script. It's awsome!
Mar 8, 2010
is there a builtin function to reinit the calendar. I'm trying to build custom buttons into the calendar that would allow changing the timeSlot. I've been able to destroy the calendar but I'm at a loss for how to recreate it from within the public methods.
Mar 8, 2010
here's a code sample:
slot15: function(){
options['slotMinutes'] = 15;
$(window).unbind('resize', windowResize);
if (header) {
header.remove();
}
content.remove();
$.removeData(_element, 'fullCalendar');
//reinit??
},
slot30: function(){
options['slotMinutes'] = 30;
$(window).unbind('resize', windowResize);
if (header) {
header.remove();
}
content.remove();
$.removeData(_element, 'fullCalendar');
//reinit??
},
slot60: function(){
options['slotMinutes'] = 60;
$(window).unbind('resize', windowResize);
if (header) {
header.remove();
}
content.remove();
$.removeData(_element, 'fullCalendar');
//reinit??
},
Mar 15, 2010
hi sneed,
reiniting the calendar is a matter of calling the basic .fullCalendar function, with all the
options again. for example:
function init(slotMinutes) { // slotMinutes is an optional parameter
$('#calendar').fullCalendar({
slotMinutes: slotMinutes
// other options
});
}
function changeSlotMinutes(v) {
$('#calendar').fullCalendar('destroy');
init(v);
}
init();
Mar 15, 2010
Issue 369 has been merged into this issue.
Jun 14, 2010
Issue 501 has been merged into this issue.
Jul 5, 2010
Issue 533 has been merged into this issue.
Nov 22, 2010
Issue 725 has been merged into this issue.
Feb 13, 2011
Issue 822 has been merged into this issue.
Feb 15, 2011
Issue 832 has been merged into this issue.
Apr 2, 2011
Issue 882 has been merged into this issue.
May 30, 2011
I'm up to add native support.
$('#calendar').fullCalendar('option', 'minTime', 9);..
..could destroy itself and reinit with its stored values?
Jul 13, 2011
See code in https://github.com/arshaw/fullcalendar/pull/25 to see how it could be possible to handle it.
Jul 20, 2011
Code by Jonathan simply resets the calendar, so you lose all the state that you had before doing it (i.e. which month you were, whether it was month/week/day view, etc.). Looking forward to getting the real enhancement by Adam.
Jul 29, 2011
any timeframe on this yet? I'd really like to be able to change some options without having the calendar refetch all of my events from the server...
Aug 24, 2011
Issue 1086 has been merged into this issue.
Sep 26, 2011
I would also like this. +1 :)
Nov 5, 2011
I would really like this as well. I would like to turn on-off the "select-ability" of the calendar dynamically. -Brian
Jan 25, 2012
I made some changes on the plugin and now I can change minTime and maxTime dynamically. I think that it works for the other options too.
I simply changed the "changeView" function to support a "force_reload" parameter that, when set to true, recreates the current View with the existent options. Then, I made a function called setOptions that simply has this code:
function setOptions(new_options) {
$.extend(options, new_options);
var viewName=currentView.name;
changeView(viewName,true);
}
I hope this can help someone in need =)
Jan 25, 2012
I forgot to specify the changes made on "changeView"...
Here are the important lines:
function changeView(newViewName,force_reload) {
[+]if (force_reload || !currentView || newViewName != currentView.name) {
....
content.css('overflow', 'hidden');
currentView = viewInstances[newViewName];
[+]if (force_reload)
[+]currentView.element.remove();
[+]if (currentView && !force_reload) {
currentView.element.show();
}else{
currentView = viewInstances[newViewName] = new fcViews[newViewName](
....
The "[+]" signals indicate changes or additions.
Aug 12, 2012
Hi there,
I put it inside this function:
*function Calendar(element, options, eventSources){*
In my case, I put it on the end of "*Misc*" functions (it's a comment that
is inside the previous function).
Oct 31, 2012
Christian's patch worked for me. The only thing it requires t.setOptions = setOptions; line in the // exports section at the top of Calendar.js
Jun 28, 2013
Has this been implemented yet?
Aug 13, 2013
(No comment was entered for this change.)
Summary:
Setters for all options
(was: setters for all options)
Labels: -Type-Enhancement Type-Feature
Aug 13, 2013
Issue 100 has been merged into this issue.
Aug 13, 2013
NOTE TO SELF: the `editable` option should be dynamically settable as well, to make the "lock" functionality mentioned in Issue 100 possible.
Aug 13, 2013
Issue 1392 has been merged into this issue.
Aug 14, 2013
Issue 1181 has been merged into this issue.
Aug 18, 2013
Issue 1567 has been merged into this issue.
Aug 18, 2013
Issue 1589 has been merged into this issue.
Aug 18, 2013
Issue 1631 has been merged into this issue.
Oct 6, 2013
Issue 2008 has been merged into this issue.
Jan 16, 2014
Did this ever get an update? The issue has been open for 4 years now.
Mar 10, 2014
Is it possible to add minTime: 8.15 and maxTime: 22:15?
Apr 23, 2014
is there now a support to change the options without destroying the whole calendar?
Apr 29, 2014
A little up for this feature, it will be very usefull for making a zoom
May 19, 2014
I solved the problem by adding a custom event to renderView function "beforeViewRender" and update the options dynamically inside the callback. I just copied the "viewRender" event in the beginning of the renderView function.
Jun 5, 2014
Until this feature is implemented for all changes across the board, here is a pull request implementing a setter specifically for `hiddenDays`: https://github.com/arshaw/fullcalendar/pull/156 via @jkrehm
Jun 5, 2014
the original pull request via @Hedi-s: https://github.com/arshaw/fullcalendar/pull/143
Aug 27, 2014
Guys i had the same need of building a zoom functionality by using the 'slotDuration' attribute. Checked the source code (fullcalendar.js, v2.02) and found a solution. Just do the following changes in the file:
1.
// Exports
// -----------------------------------------------------------------------------------
t.options = options;
[..]
t.trigger = trigger;
=> Add one line at the end (after 't.trigger = trigger;') saying 't.refreshView = refreshView;'
2.
// View Rendering
// -----------------------------------------------------------------------------------
=> Add following code directly after this:
function refreshView()
{
_changeView(currentView.name);
}
3.
function option(name, value)
=> Change this function to following code:
function option(name, value) {
if (value === undefined) {
return options[name];
}
if (name == 'height' || name == 'contentHeight' || name == 'aspectRatio') {
options[name] = value;
updateSize();
}
if (name == 'slotDuration')
{
options[name] = value;
refreshView();
}
}
You can now set the 'slotDuration' on the fly by executing a javascript like '$('#calendar').fullCalendar( 'option', 'slotDuration', '00:10:00')'
Dec 14, 2014
Issue 1181 has been merged into this issue.
Jan 14, 2015
any updates on this ability to dynamically change options?
Mar 25, 2015
I would like to give my users the chance to toggle some days in the week view so they could optimize screen space and get a more responsive view. To do so, I would need to tweak 'hiddenDays' attribute. Would there be a way to achieve it without having to destroy and rerender the whole thing ?
Apr 18, 2015
Adam, Is there any update on this yet? or suggest a best way to set minTime/maxTime dynamically
Jun 28, 2015
unbelievable, the author kept merging other issues to this one, but this feature has been requested for 5 years without any progress.
Aug 21, 2015
Discussion for this issue has moved to the following URL: https://github.com/fullcalendar/fullcalendar/issues/564 This is because Google Code is shutting down. Apologies if you are being pestered with these notifications. This is a one-time event. Happy coding, Adam
Status:
ExportedToGithub
|
|
| ► Sign in to add a comment |
Status: Accepted
Labels: -Type-Defect Type-Enhancement