קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
ButtonSet
enum שמייצג קבוצות מוגדרות מראש ומתורגמות של לחצן אחד או יותר של תיבת דו-שיח, שאפשר להוסיף ל-alert או ל-prompt. כדי לקבוע על איזה לחצן המשתמש לחץ, משתמשים ב-Button.
כדי לקרוא למאפיין enum, צריך לקרוא לכיתה ההורה, לשם ולנכס שלו. לדוגמה,
Base.ButtonSet.OK.
// 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.');}
מאפיינים
נכס
סוג
תיאור
OK
Enum
לחצן 'אישור' יחיד, שמציין הודעה מידע שאפשר רק לסגור.
OK_CANCEL
Enum
לחצן 'אישור' ולחצן 'ביטול', שמאפשרים למשתמש להמשיך או להפסיק פעולה.
YES_NO
Enum
לחצן 'כן' ולחצן 'לא', שמאפשרים למשתמש לענות על שאלה מסוג כן/לא.
YES_NO_CANCEL
Enum
לחצן 'כן', לחצן 'לא' ולחצן 'ביטול', שמאפשרים למשתמש לענות על שאלה מסוג 'כן/לא' או להפסיק פעולה.
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\u003cp\u003e\u003ccode\u003eButtonSet\u003c/code\u003e is an enum used to create predefined, localized button sets for dialog boxes in Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eIt provides options like \u003ccode\u003eOK\u003c/code\u003e, \u003ccode\u003eOK_CANCEL\u003c/code\u003e, \u003ccode\u003eYES_NO\u003c/code\u003e, and \u003ccode\u003eYES_NO_CANCEL\u003c/code\u003e for different dialog scenarios.\u003c/p\u003e\n"],["\u003cp\u003eYou can determine the user's button click by comparing the response to \u003ccode\u003eui.Button\u003c/code\u003e values.\u003c/p\u003e\n"],["\u003cp\u003eThese button sets are used with \u003ccode\u003ealert()\u003c/code\u003e and \u003ccode\u003eprompt()\u003c/code\u003e methods of the \u003ccode\u003eUi\u003c/code\u003e class.\u003c/p\u003e\n"]]],[],null,[]]