사용자가 새로운
일정(Event)을 추가 시 발생
하는 콜백(callback) 함수를 정의할 수 있습니다.
function
콜백(callback) 함수 정의 시
"eventAddInfo"
객체를 parameter로 사용할 수 있습니다.
"eventAddInfo"
parameter 객체는 다음과 같은 속성들을 포함하고 있습니다.
Parameter | DataType | 설명 |
---|---|---|
events |
array |
새로 추가한 일정(Event) EventApi 객체 정보 배열 |
eventInputs |
array |
EventApi 객체의 정보들을 파싱한 eventInput 배열(서버에 데이터 저장시 사용) |
options = {
eventSources: [
{
id: "eventSource1",
eventAdd: function(eventAddInfo) {
console.log("eventInputs 배열 :", eventAddInfo.eventInputs);
$.ajax(
{
"url": "https://URL"
"method": "POST",
"async": false,
"contentType": "application/json",
"dataType": "json",
"data": JSON.stringify({
events: eventAddInfo.eventInputs,
}),
"success": function (data, status, xhr) {
},
"error": function (xhr, status, errorThrown) {
console.log(status);
}
}
);
}
events: function(info, success, failure) {
$.ajax(
{
"url": "https://URL"
"method": "GET",
"async": false,
"dataType": "json",
"data": {
start: IBCalendar.DateTime.fromJSDate(info.start).toISO(),
end: IBCalendar.DateTime.fromJSDate(info.end).toISO()
},
success: function (data, status, xhr) {
success(data);
},
error: function (xhr, status, errorThrown) {
failure(status);
}
}
);
}
],
]
};
product | version | desc |
---|---|---|
core | 1.5.0.0 | 기능 추가 |