Class ButtonSet
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
ButtonSet
מאגר של אובייקטים מסוג Button
שמוצגים בשורה.
התכונה זמינה בתוספים ל-Google Workspace ובאפליקציות של Google Chat.
const textButton = CardService.newTextButton();
// Finish building the text button...
const imageButton = CardService.newImageButton();
// Finish building the image button...
const buttonSet =
CardService.newButtonSet().addButton(textButton).addButton(imageButton);
מסמכים מפורטים
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\u003cp\u003e\u003ccode\u003eButtonSet\u003c/code\u003e objects organize and display a row of \u003ccode\u003eButton\u003c/code\u003e objects within Google Workspace Add-ons and Google Chat apps.\u003c/p\u003e\n"],["\u003cp\u003eYou can add buttons, which can be either text-based or image-based, to a \u003ccode\u003eButtonSet\u003c/code\u003e using the \u003ccode\u003eaddButton()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eaddButton()\u003c/code\u003e method allows for building the layout by adding \u003ccode\u003eButton\u003c/code\u003e objects and facilitating chained operations for efficient design.\u003c/p\u003e\n"]]],["The `ButtonSet` object holds and displays a row of `Button` objects. You can create a `ButtonSet` using `CardService.newButtonSet()`. To add buttons, use the `addButton(button)` method, passing in a `Button` object. This method can be chained to add multiple buttons sequentially. `addButton` returns the `ButtonSet` object itself. This functionality is available for Google Workspace add-ons and Google Chat apps.\n"],null,["# Class ButtonSet\n\nButtonSet\n\nHolds a set of [Button](/apps-script/reference/card-service/button) objects that are displayed in a row.\n\nAvailable for Google Workspace add-ons and Google Chat apps.\n\n```javascript\nconst textButton = CardService.newTextButton();\n// Finish building the text button...\n\nconst imageButton = CardService.newImageButton();\n// Finish building the image button...\n\nconst buttonSet =\n CardService.newButtonSet().addButton(textButton).addButton(imageButton);\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------------------|----------------|-------------------|\n| [addButton(button)](#addButton(Button)) | [ButtonSet](#) | Adds a button. |\n\nDetailed documentation\n----------------------\n\n### `add``Button(button)`\n\nAdds a button.\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|------------------------------------------------------|--------------------|\n| `button` | [Button](/apps-script/reference/card-service/button) | The button to add. |\n\n#### Return\n\n\n[ButtonSet](#) --- This object, for chaining."]]