Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#deps").change(function(event){
- // Obtenemos todos datos de departamentos
- $.get("calendarInfo/"+event.target.value+"",function(response,state){
- console.log(response);
- if(response.length < 0) {
- // Si seleccionas la primera opcion por defecto "seleccionar" no hace nada
- }
- else {
- console.log(response[0]);
- var newEventsList = new Array();
- // Nuevo evento
- for(i=0; i < response.length; i++){
- //console.log(response);
- newEventsList [0] = new Object();
- newEventsList [0]["id"] = response[0].id;
- newEventsList [0]["title"] = response[0].titulo;
- newEventsList [0]["start"] = response[0].fechaIni;
- newEventsList [0]["end"] = response[0].fechaFin;
- $('#fc-default').fullCalendar('addEventSource', newEventsList);
- $('#fc-default').fullCalendar('rerenderEvents');
- //$('#fc-default').fullCalendar('refetchEvents' );
- console.log('Evento cargado,fin ejecución');
- }
- }
- });
- });
Add Comment
Please, Sign In to add comment