Ho problemi ad aggiungere un nuovo evento a fullCalendar usando Jquery. Sto usando Eclipse per sviluppare web e non ho familiarità con Ajax affatto e aperantly, non funziona con la mia eclissi.Inserisci evento dinamicamente su Fullcalendar usando Jquery
Tutto è scritto all'interno di una funzione button.click in jquery.
var subject = $("#txtEventName").val(); //the title of the event
var dateStart = $("#txtDate").val(); //the day the event takes place
var dateEnd = $("#txtDateEnd").val(); //the day the event finishes
var allDay = $("#alldayCheckbox").val(); //true: event all day, False:event from time to time
var events=new Array();
event = new Object();
event.title = subject;
event.start = dateStart; // its a date string
event.end = dateEnd; // its a date string.
event.color = "blue";
event.allDay = false;
events.push(event);
$('#calendar').fullCalendar('addEventSource',events);
Nessun errore rilevato ma l'evento non è stato creato. P.S: Vorrei rimanere con il feed di array se non altro in jQuery.
"evento" è una parola di riserva in Javascript, quindi modificare il nome dell'oggetto "evento" nel codice, potrebbe funzionare. –
@Furqan l'ho fatto, non funziona ancora :( –
Quali file .js hai incluso nel tuo codice HTML? – ganeshk