Add Events in edit mode with JSON
Hi Lukasz,
I have tried several ways to get the Responsive Calendar accepting a result from a JSON result, but without luck, how should this be performed?
I have version 0.9 of Responsive Calendar, JQuery 1.11.3 The calendar works perfect, when I set the values hardcoded in the Javascript.
This working fine: $('.responsive-calendar').responsiveCalendar('edit', { "2015-09-10": {} });
This is not working:
var date = "2015-09-10";
$('.responsive-calendar').responsiveCalendar('edit', { date: {} });
Best regards Lars
Comments (5)
-
repo owner -
reporter Hi Lukasz,
I have experienced this, but how can I then add events dynamicly to the calendar. I can't find any examples of this?
Best Regards Lars
-
repo owner For example like this:
var events = { "2013-04-30": {"number": 5, "badgeClass": "badge-warning", "url": "http://w3widgets.com/responsive-calendar"}, "2013-04-26": {"number": 1, "badgeClass": "badge-warning", "url": "http://w3widgets.com"}, "2013-05-03": {"number": 1, "badgeClass": "badge-error"}, "2013-06-12": {} }; $('#calendar').responsiveCalendar('edit', events);
You have to format the input data as an object.
-
reporter I will try this instead.
-
reporter - changed status to resolved
I have got it to work now, Thanks for leading my the rigth way.
- Log in to comment
You cannot use variable as an object key. follow the examples from the webpage