Class 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 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[[["\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."]]