alert 또는 prompt에 추가할 수 있는 하나 이상의 대화상자 버튼의 미리 결정되고 현지화된 세트를 나타내는 열거형입니다. 사용자가 어떤 버튼을 클릭했는지 확인하려면 Button를 사용합니다.
// Display a dialog box with a message and "Yes" and "No" buttons.
var ui = DocumentApp.getUi();
var response = ui.alert('Are you sure you want to continue?', ui.ButtonSet.YES_NO);
// Process the user's response.
if (response == ui.Button.YES) {
Logger.log('The user clicked "Yes."');
} else {
Logger.log('The user clicked "No" or the dialog\'s close button.');
}
속성
속성
유형
설명
OK
Enum
닫을 수 있는 정보 메시지를 나타내는 단일 '확인' 버튼.
OK_CANCEL
Enum
'확인' 버튼과 '취소' 버튼을 사용하여 사용자가 작업을 계속하거나 중지할 수 있습니다.
YES_NO
Enum
사용자가 예/아니요 질문에 답변할 수 있도록 하는 '예' 버튼과 '아니요' 버튼.
YES_NO_CANCEL
Enum
사용자가 예/아니요 질문에 답하거나 작업을 중지할 수 있는 '예' 버튼, '아니요' 버튼, '취소' 버튼.