Enabling dynamic selection mode

When I configure fullCalendar with the initialization parameter "selectable: true", the select function is important, but I need to enable / disable this function dynamically! That is, the calendar stars are turned off with no choice, then the user presses the button, and I turn it on, click another button, and I turn it off again.

I checked the "Height" parameter API page (http://arshaw.com/fullcalendar/docs/display/height/) and it shows that I can set this parameter dynamically, but when I adapt the code to the "selectable" parameter, he does not do anything:

$('#calendar').fullCalendar("option", "selectable", true); 

Any ideas? Thanks!

-Brian

+4
source share
2 answers

I have not tried this, but there seems to be a "render" method, perhaps that displays the full state, including whether you can choose or not. Try:

 $('#calendar').fullCalendar("option", "selectable", true) .fullCalendar("render"); 

If this does not work, you can try re-creating your calendar by first destroying it:

 $('#calendar').fullCalendar('destroy') .fullCalendar({selectable: false, your: 'other', options: 'here'}); 
0
source

Starting with version 2.9.0, you can dynamically set parameters after initialization. These parameter changes will be applied to all views. At this time, it is not possible to configure viewing options in this way.

You can dynamically set one option:

 $('#calendar').fullCalendar('option', 'locale', 'fr'); 

Or, if you want to set several parameters at once, limiting the calendar to no more than one redrawing, pass the parameter hash:

 $('#calendar').fullCalendar('option', { locale: 'fr', isRTL: true }); 

https://fullcalendar.io/docs/v3/dynamic-options

0
source

Source: https://habr.com/ru/post/1333452/


All Articles