eventChange (Properties)

사용자가 일정(Event)을 수정 시 발생하는 콜백(callback) 함수를 정의할 수 있습니다.

Type

function

Example

콜백(callback) 함수 정의 시 "eventChangeInfo" 객체를 parameter로 사용할 수 있습니다.
"eventChangeInfo" parameter 객체는 다음과 같은 속성들을 포함하고 있습니다.

Parameter DataType 설명
events array 수정한 일정(Event) EventApi 객체 정보 배열
eventInputs array EventApi 객체의 정보들을 파싱한 eventInput 배열(서버에 데이터 저장시 사용)
options = {
    eventSources: [
        {
            id: "eventSource1",
            eventChange: function(eventChangeInfo) {
                console.log("eventInputs 배열 :", eventChangeInfo.eventInputs);
                $.ajax(
                    {
                        "url": "https://URL"
                        "method": "PUT",
                        "async": false,
                        "contentType": "application/json",
                        "dataType": "json",
                        "data": JSON.stringify({
                            events: eventChangeInfo.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);
                        }
                    }
                );
            }
        ],
    ]
};

Since

product version desc
core 1.5.0.0 기능 추가