다음을 통해 공유


addEventHandler(클라이언트 API 참조)

지정된 이벤트에 대한 이벤트 처리기를 추가합니다.

지원되는 컨트롤 형식

사용자 정의 코드 구성 요소

Syntax

  const controlName1 = "cr116_personid";

  this.onLoad = function (executionContext) {
    const formContext = executionContext.getFormContext();

    const sampleControl1 = formContext.getControl(controlName1);
    sampleControl1.addEventHandler("customEvent1", this.onSampleControl1CustomEvent1);
    sampleControl1.addEventHandler("customEvent2", this.onSampleControl1CustomEvent2);
  }

매개 변수

이름 유형 필수 Description
name 문자열 yes 사용자 지정 구성 요소에 대해 구성된 사용자 지정 이벤트의 이름입니다.
function 기능 Yes 명명된 이벤트에 추가할 함수입니다. 실행 컨텍스트는 이 함수에 대한 첫 번째 매개 변수로 자동으로 전달됩니다.

이벤트 정의