jquery - Events not displayed in fullcalendar js -


Please help someone figure out what's wrong with the code. I used fullcalendar.js for the calendar event.

I want to show the event in the calendar. Below is my code.

  $ (document) .ready (function () {$ (window). reset (function () {$ ('# calendar'). fullCalendar ('option', 'height' get_calendar_height ());}); var date = new date (); var d = date.getDate (); var m = date.getMonth (); var y = date.getFullYear (); var navent = []; nevent = document.getElementById ('& lt;% = hdnevent.ClientID%';); value; // alerts (nevent); var calendar = $ ('# calendar'). FullCalendar ({Subject: true, title: {left: 'prev, next today', center: 'title', right: 'month, agendaWeek, agendaDay', width: get_calendar_width}, width: get_calendar_width, height: 480, select: right, selectHelper: true, slots min: 15 , All data default: false, // events: 'JasonRespons.Shex', events: navent});});   

nevent is the value:

  [{id: '2302', title: 'XXX', start: '4 / 4/2014 12:00:00 AM, '4/4/2014 12:00:00 AM, 'all day: true, url:' xxx '}]   

But this does not appear in the calendar if I have specified the direct value, then it will display the event (example: event: [{id: '2302', title: 'XXX', start: '4/4/2014 12:00:00 AM, '4/4/2014 12:00:00 AM,' All day: true, url: 'xxx'}] )

Please allow me to Help improve my error .

After updating the data, the calendar must be asked to update. Try:

  $ ("# calendar"). FullCalendar ('removeEvents'); $ ("# Calendar"). FullCalendar ('addEventSource', Nement); $ ("# Calendar") Fullcalendar ('rerenderEvents').  

Edit:

Accept the input as JSON object string:

  nevent = $ .parseJSON (document.getElementById ('& lt;% = hdnevent.ClientID% & gt;'.)););   

Note that JSON should be in the correct format with quotation marks:

  [{"id": "2302", "title": "XXX", "Start": "4/4/2014 12:00:00 AM", "End": "4/4/2014 12:00:00 AM", "All Day": True, "url ":" Xxx "}]    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -