提供意見
Enum Button
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
按鈕 列舉代表 alert
或 PromptResponse.getSelectedButton()
傳回的預先決定本地化對話方塊按鈕,指出使用者在對話方塊中點選的按鈕。無法設定這些值。如要在 alert
或 prompt
中新增按鈕,請改用 ButtonSet
。
如要呼叫列舉,您可以呼叫其父項類別、名稱和屬性。例如
Base.Button.CLOSE
。
// 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.');
}
屬性
屬性 類型 說明
CLOSE
Enum
每個對話方塊標題列中顯示的標準關閉按鈕。這個按鈕未明確加入對話方塊,因此無法移除。
OK
Enum
「OK」按鈕,表示應繼續作業。
CANCEL
Enum
顯示「取消」按鈕,表示不應繼續執行作業。
YES
Enum
「是」按鈕,表示對問題有正面回覆。
NO
Enum
「否」按鈕,表示對問題有負面回覆。
提供意見
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權 ,程式碼範例則為阿帕契 2.0 授權 。詳情請參閱《Google Developers 網站政策 》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2023-12-01 (世界標準時間)。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"缺少我需要的資訊"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"過於複雜/步驟過多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"過時"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻譯問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/程式碼問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"容易理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"確實解決了我的問題"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]
想進一步說明嗎?