Closed valerio-bozzolan closed 3 years ago
P.S.
Inspecting the source code I've found this undocumented way that seems to work:
$calendar.data('plugin_simpleCalendar').settings.events = myEvents;
A very ugly workaround I think.
Yes I wanted to implements methods to add or access events. PR welcome !
Ugly workaround
$("#calendar").simpleCalendar().data('plugin_simpleCalendar').settings.events = [ ];
var currentDate = $("#calendar").simpleCalendar().data('plugin_simpleCalendar').currentDate;
var calendar = $("#calendar").find('.calendar');
$("#calendar").simpleCalendar().data('plugin_simpleCalendar').buildCalendar(currentDate, calendar);
Any news about this development? The workaround talked here does not work, data('plugin_simpleCalendar') gives me undefined.
I need to update displayed event depending of a user choice.
Any way to update calendar, or destroy instance and initiate again?
I've added a new PR with the above mentioned adding event functionality. @AidosMarcos @brospars
Close by #32
Hello!
Just a question. Is it possible to update Events after initialization?
I tried calling again
$calendar.simpleCalendar( { events: myEvents } )
but without much success, but maybe I'm doing something wrong.Thank you :)