Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Tombol
Enum yang mewakili tombol dialog yang telah ditentukan dan dilokalkan yang ditampilkan oleh alert atau PromptResponse.getSelectedButton() untuk menunjukkan
tombol mana dalam dialog yang diklik pengguna. Nilai ini tidak dapat ditetapkan; untuk menambahkan tombol ke
alert atau prompt, gunakan ButtonSet.
Untuk memanggil enum, Anda memanggil class induk, nama, dan propertinya. Misalnya,
Base.Button.CLOSE.
// Display a dialog box with a message and "Yes" and "No" buttons.constui=DocumentApp.getUi();constresponse=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.');}
Properti
Properti
Jenis
Deskripsi
CLOSE
Enum
Tombol tutup standar yang ditampilkan di setiap panel judul dialog. Tombol ini tidak ditambahkan secara eksplisit
ke dialog, dan tidak dapat dihapus.
OK
Enum
Tombol "OK", yang menunjukkan bahwa operasi harus dilanjutkan.
CANCEL
Enum
Tombol "Cancel", yang menunjukkan bahwa operasi tidak boleh dilanjutkan.
YES
Enum
Tombol "Ya", yang menunjukkan respons positif terhadap pertanyaan.
NO
Enum
Tombol "Tidak", yang menunjukkan respons negatif terhadap pertanyaan.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eButton\u003c/code\u003e is an enum representing localized dialog buttons returned by alerts or prompts, indicating user action.\u003c/p\u003e\n"],["\u003cp\u003eThese predetermined button values (\u003ccode\u003eCLOSE\u003c/code\u003e, \u003ccode\u003eOK\u003c/code\u003e, \u003ccode\u003eCANCEL\u003c/code\u003e, \u003ccode\u003eYES\u003c/code\u003e, \u003ccode\u003eNO\u003c/code\u003e) cannot be set directly but are accessed via \u003ccode\u003eui.Button\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo add buttons to alerts or prompts, use \u003ccode\u003eButtonSet\u003c/code\u003e instead of individual \u003ccode\u003eButton\u003c/code\u003e values.\u003c/p\u003e\n"],["\u003cp\u003eThe provided example code demonstrates using \u003ccode\u003eButton\u003c/code\u003e to handle user responses from a dialog.\u003c/p\u003e\n"]]],[],null,[]]