cabrillo.modal - 클라이언트

  • 릴리스 버전: Yokohama
  • 업데이트 날짜 2025년 01월 30일
  • 읽기3분
  • 카브릴로 JS 네이티브 모달 내부에 웹 컨텐츠를 표시하는 함수입니다.

    cabrillo.modal - dismissModal(객체 데이터)

    presentModal() 함수와 함께 제공된 모달을 해제하는 데 사용합니다.

    제시된 모달은 자신을 해제하고 결과를 제시하는 컨텍스트로 다시 전달하는 역할을 합니다. dismissModal() 함수는 현재 컨텍스트가 아닌 제시된 컨텍스트에서 호출되어야 합니다.

    표 1. 매개변수
    이름 유형 설명
    데이터 객체 옵션입니다. 제시된 컨텍스트가 스스로를 해제할 때 제시하는 컨텍스트로 다시 전달할 객체입니다.
    표 2. 반환
    유형 설명
    약속 성공하면 해결되지 않은 객체, 그렇지 않으면 오류가 발생합니다.
    // Any object can be passed back to the presenting context when the presented context dismisses itself.
    var results = {
        team: 'Mobile'
        company: 'ServiceNow'
    }
    
    cabrillo.modal.dismissModal(results).then(function() {
        console.log('Modal was dismissed and results were passed to presenting context.');
    }, function(error) {
        console.log(error);
    });

    cabrillo.modal - presentModal( 문자열 제목, 문자열 URL, 문자열 closeButtonStyle, 문자열 modalPresentationStyle)

    네이티브 모달 인터페이스에 컨텐츠를 표시합니다.

    표 3. 매개변수
    이름 유형 설명
    제목 문자열 모달 인터페이스의 제목입니다.
    URL 문자열 모달을 열 URL입니다. 내부 인스턴스 URL(정규화된 URL 또는 상대 URL이 선호됨)이어야 합니다.
    closeButton스타일 문자열 모달 인터페이스의 닫기 버튼 스타일입니다.
    가능한 값:
    • cabrillo.modal.CLOSE_BUTTON_STYLE_CANCEL
    • cabrillo.modal.CLOSE_BUTTON_STYLE_CLOSE
    • cabrillo.modal.CLOSE_BUTTON_STYLE_DONE
    자세한 내용은 Cabrillo JS 상수 - 닫기 버튼 스타일 문서를 참조하십시오.
    modalPresentationStyle 문자열 모달 인터페이스의 프레젠테이션 스타일입니다.
    가능한 값:
    • cabrillo.modal.MODAL_PRESENTATION_STYLE_FULL_SCREEN
    • cabrillo.modal.MODAL_PRESENTATION_STYLE_FORM_SHEET
    자세한 내용은 Cabrillo JS 상수 - 모달 프레젠테이션 스타일 문서를 참조하십시오.
    주:
    이 매개변수는 .Apple iOS
    표 4. 반환
    유형 설명
    약속 성공하면 Cabrillo.ModalResponse 개체, 그렇지 않으면 오류가 발생합니다.

    사용자 지정 URL을 로드하는 네이티브 모달을 제공합니다. 이렇게 하면 사용자 지정 서비스 포털 페이지가 폼 시트 스타일 모달에 표시됩니다. 그 약속은 모달이 기각될 때 성취된다. 사용자 정의 해제 기능에 대해서는 dismissModal() 함수를 참조하십시오.

    cabrillo.modal.presentModal('Portal Page',
        '/$sp.do?id=my_modal_page',
        cabrillo.modal.CLOSE_BUTTON_STYLE_CLOSE,
        cabrillo.modal.MODAL_PRESENTATION_STYLE_FORM_SHEET
    ).then(function(response) {
        // The results from the modal are in a results key on the response object.
        var results = response && response.results ? response.results : null;
    
        if (results) {
            console.log('Modal dismissed with results.', results);
        } else {
            console.log('Modal dismissed without results.');
        }
    }, function(error) {
        console.log(error);
    });