My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 293: Setters for all options
59 people starred this issue and may be notified of changes. Back to list
Status:  ExportedToGithub
Owner:  ----
Closed:  Aug 2015


Sign in to add a comment
 
Reported by marcin.m...@gmail.com, Jan 15, 2010
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!

Jan 19, 2010
Project Member #1 adamrs...@gmail.com
hi marcin,
yeah, having option "setters" is something i've been meaning to get to. can't say
when though.

for now, what you could do is destroy the calendar
(http://arshaw.com/fullcalendar/docs/display/destroy/) then re-initialize it. sort of
clunky, but might work for you.

accepting this issue on the grounds of having "setters" for all options.
Summary: setters for all options
Status: Accepted
Labels: -Type-Defect Type-Enhancement
Mar 8, 2010
#2 sneed...@gmail.com
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
#3 sneed...@gmail.com
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
Project Member #4 adamrs...@gmail.com
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
Project Member #5 adamrs...@gmail.com
 Issue 369  has been merged into this issue.
Jun 14, 2010
Project Member #6 adamrs...@gmail.com
 Issue 501  has been merged into this issue.
Jul 5, 2010
Project Member #7 adamrs...@gmail.com
 Issue 533  has been merged into this issue.
Nov 22, 2010
Project Member #8 adamrs...@gmail.com
 Issue 725  has been merged into this issue.
Feb 13, 2011
Project Member #9 adamrs...@gmail.com
 Issue 822  has been merged into this issue.
Feb 15, 2011
Project Member #10 adamrs...@gmail.com
 Issue 832  has been merged into this issue.
Apr 2, 2011
Project Member #11 adamrs...@gmail.com
 Issue 882  has been merged into this issue.
May 30, 2011
#12 jonathan.huot
I'm up to add native support.

$('#calendar').fullCalendar('option', 'minTime', 9);..
..could destroy itself and reinit with its stored values?
Jul 13, 2011
#13 jonathan.huot
See code in https://github.com/arshaw/fullcalendar/pull/25 to see how it could be possible to handle it.
Jul 20, 2011
#14 e.medin...@gmail.com
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
#15 jer...@zignage.com
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
Project Member #16 althaus.it
 Issue 1086  has been merged into this issue.
Sep 26, 2011
#17 jor...@24hrassistant.com
I would also like this. +1 :)
Nov 5, 2011
#18 bhen...@gmail.com
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
#19 cristian...@gmail.com
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
#20 cristian...@gmail.com
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
#22 cristian...@gmail.com
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
#23 sergey.v...@gmail.com
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
#24 tdragsb...@gmail.com
Has this been implemented yet?
Aug 13, 2013
Project Member #25 adamrs...@gmail.com
(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
Project Member #26 adamrs...@gmail.com
 Issue 100  has been merged into this issue.
Aug 13, 2013
Project Member #27 adamrs...@gmail.com
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
Project Member #28 adamrs...@gmail.com
 Issue 1392  has been merged into this issue.
Aug 14, 2013
Project Member #29 adamrs...@gmail.com
 Issue 1181  has been merged into this issue.
Aug 18, 2013
Project Member #30 adamrs...@gmail.com
 Issue 1567  has been merged into this issue.
Aug 18, 2013
Project Member #31 adamrs...@gmail.com
 Issue 1589  has been merged into this issue.
Aug 18, 2013
Project Member #32 adamrs...@gmail.com
 Issue 1631  has been merged into this issue.
Oct 6, 2013
Project Member #33 adamrs...@gmail.com
 Issue 2008  has been merged into this issue.
Jan 16, 2014
#34 boel...@gmail.com
Did this ever get an update? The issue has been open for 4 years now.
Mar 10, 2014
#35 immandot...@gmail.com
Is it possible to add minTime: 8.15 and maxTime: 22:15?
Apr 23, 2014
#36 justme.t...@gmail.com
is there now a support to change the options without destroying the whole calendar?
Apr 29, 2014
#37 cedric.c...@gmail.com
A little up for this feature, it will be very usefull for making a zoom
May 19, 2014
#38 leon.pan...@gmail.com
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
Project Member #39 adamrs...@gmail.com
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
Project Member #40 adamrs...@gmail.com
the original pull request via @Hedi-s:
https://github.com/arshaw/fullcalendar/pull/143
Aug 27, 2014
#41 ti08m...@gmail.com
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
Project Member #42 adamrs...@gmail.com
 Issue 1181  has been merged into this issue.
Jan 14, 2015
#43 war...@gmail.com
any updates on this ability to dynamically change options?
Mar 25, 2015
#44 inf...@gmail.com
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
#45 abu.abs...@gmail.com
Adam, Is there any update on this yet? or suggest a best way to set minTime/maxTime dynamically
Jun 28, 2015
#46 a.perky....@gmail.com
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
Project Member #47 adamrs...@gmail.com
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

Powered by Google Project Hosting