Mostrar título del evento en modal con fullcalendar
Publicado por raquel (12 intervenciones) el 17/07/2020 20:20:29
Buenas chicos, estoy haciendo un calendario de eventos con fullcalendar v5 y han cambiado varias cosillas con respecto a la version anterior, y estoy un poco perdida porque en la documentacion no veo nada.
El caso es que me gustaria mostrar el titulo del evento y la descripcion en la ventana modal que se abre cuando se hace click en un dia determinado.
Hasta ahí todo bien exceptuando que no me muestra el titiulo ni la descripcion. Sabeis que puede ser??
Muchisimas gracias por la ayuda!
El caso es que me gustaria mostrar el titulo del evento y la descripcion en la ventana modal que se abre cuando se hace click en un dia determinado.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl,
{
initialView: 'dayGridMonth',
locale: 'es',
headerToolbar: {
left: 'today,prev,next,Miboton',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay'
},
customButtons:{
Miboton:{
text: 'Botón 1',
click: function(){
alert("Acción del botón");
}
}
},
dateClick: function(info){
alert("valor seleccionado: " + info.dateStr);
alert('Current view: ' + info.view.type);
info.dayEl.style.backgroundColor = 'red';
$("#exampleModal").modal();
},
eventSources: [{
events: [
{
title : 'evento 1',
descripcion:"hola",
start : '2020-07-25',
color:"black",
textColor:"yellow"
},
{
title : 'evento 2',
descripcion:"hola hola",
start : '2020-08-05',
end : '2020-08-07',
color:"pink",
textColor:"blue"
},
{
title : 'evento 3',
descripcion:"hola caracola",
start : '2020-07-29T12:30:00',
allDay : false // will make the time show
}
],
color:"black",
textColor:"yellow"
}],
eventClick: function(info){
//alert('Event: ' + info.event.title);
//alert('Coordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY);
//alert('View: ' + info.view.type);
info.el.style.borderColor = 'red';
$("#tituloEvento").html(info.title);//ESTO ES LO QUE NO ME MUESTRA
$("#descripcionEvento").html(info.descripcion);//ESTO TAMPOCO LO MUESTRA
$("#exampleModal").modal();
}
});
calendar.render();
calendar.setOption('locale', 'es');
});
Hasta ahí todo bien exceptuando que no me muestra el titiulo ni la descripcion. Sabeis que puede ser??
Muchisimas gracias por la ayuda!
Valora esta pregunta


0