anndysaac / jmonthcalendar

Automatically exported from code.google.com/p/jmonthcalendar
Other
0 stars 0 forks source link

binding events dynamically on click of next/prev from database #50

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

Wants to bind the events dynamically for different months.

Any suggestion!!
Any Help!!

Regards

Original issue reported on code.google.com by kantravi...@gmail.com on 19 Jul 2012 at 9:19

GoogleCodeExporter commented 8 years ago
Always fetch all the events from the database and keep adding it to the Events 
array. Once added, display the calendar.

A Sample code is below,
Add all the events in a while loop which are present in your database, later do 
initialize the calendar, and you calendar contains all the events present in 
the database.
  allEvents = [];           
  var testBedName = tbNameV.value;
   extraEvents =  { 
    "EventID":  <%=tbres.getID()%>,
    "StartDateTime": "<%=tbres.getStartDate() %>", 
    "EndDateTime": "<%=tbres.getEndDate() %>",
        "Title": testBedName,
    "URL": "#",
    "Description": "<%=tbres.getPurpose()%>",
    "CssClass": "TestBed_<%=tbres.getTestbedId()%>",
    "TeamName": "<%=tbres.getTeamName()%>"
    };
    allEvents.push(extraEvents);

//End of While loop

    $.jMonthCalendar.Initialize(options, allEvents);

Original comment by singhujj...@gmail.com on 20 Sep 2012 at 5:50