我有以下代码和JSON输出。我的问题是如何访问JSON中的ID。我已经在代码中尝试过,但是它返回的状态未定义
代码
var calendarEl = document.getElementById("calendar");
var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: [ 'dayGrid' ],
timeZone: 'UTC',
defaultView: 'dayGridMonth',
events: '/cc/AjaxCustom/getOvertimeCalendar',
timeFormat: 'H(:mm)',
contentHeight: 600,
eventClick: function(event, jsEvent, view) {
console.log(event.id);
$('#overtime'+event.ref).modal('show');
}
});
calendar.render();
JSON
[ { "id": "154329", "title": "#123ABC", "allday": false, "start": "2019-06-12T09:54:00", "end": "2019-06-13T10:55:00" }, { "id": "160001", "title": "ABCDEF", "allday": false, "start": "2019-06-26T16:32:00", "end": "2019-06-28T16:32:00" } ]