تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eCollapseControl is a customizable control that allows users to collapse and expand content within Google Chat apps and Google Workspace Add-ons (in developer preview).\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize the appearance and behavior of the CollapseControl using methods to set collapse and expand buttons, as well as horizontal alignment.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esetCollapseButton\u003c/code\u003e and \u003ccode\u003esetExpandButton\u003c/code\u003e methods allow for assigning custom buttons to control the expansion and collapse actions.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esetHorizontalAlign\u003c/code\u003e method enables developers to control the horizontal positioning of the CollapseControl within its container.\u003c/p\u003e\n"]]],[],null,["CollapseControl\n\nA customizable collapse and expand control.\n\nAvailable for Google Chat apps. In developer preview for Google Workspace add-ons.\n\n\n| **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features.\n\n\u003cbr /\u003e\n\n```javascript\nconst collapseButton =\n CardService.newTextButton()\n .setTextButtonStyle(CardService.TextButtonStyle.BORDERLESS)\n .setText('Collapse');\n\nconst expandButton =\n CardService.newImageButton()\n .setImageButtonStyle(CardService.ImageButtonStyle.FILLED);\n\nconst collapseControl =\n CardService.newCollapseControl()\n .setHorizontalAlign(CardService.HorizontalAlignment.END)\n .setExpandButton(expandButton)\n .setCollapseButton(collapseButton);\n``` \n\nMethods\n\n| Method | Return type | Brief description |\n|-------------------------------------------------------------------------------------|----------------------|-----------------------------------------------------------------------------------------------------------------------|\n| [setCollapseButton(button)](#setCollapseButton(Button)) | [CollapseControl](#) | Sets the [Button](/apps-script/reference/card-service/button) that is displayed for \"show less\" button. |\n| [setExpandButton(button)](#setExpandButton(Button)) | [CollapseControl](#) | Sets the [Button](/apps-script/reference/card-service/button) that is displayed for \"show more\" button. |\n| [setHorizontalAlign(horizontalAlignment)](#setHorizontalAlign(HorizontalAlignment)) | [CollapseControl](#) | Sets the [HorizontalAlignment](/apps-script/reference/card-service/horizontal-alignment) of the [CollapseControl](#). |\n\nDetailed documentation \n\n`set``Collapse``Button(button)` \nSets the [Button](/apps-script/reference/card-service/button) that is displayed for \"show less\" button. Optional. \n\nMust be set together with collapse button.\n\n```javascript\nconst collapseButton =\n CardService.newTextButton().setText('Collapse');\n\nconst collapseControl =\n CardService.newCollapseControl()\n .setCollapseButton(collapseButton);\n```\n\nParameters\n\n| Name | Type | Description |\n|----------|------------------------------------------------------|-----------------------------|\n| `button` | [Button](/apps-script/reference/card-service/button) | The collapse button to set. |\n\nReturn\n\n\n[CollapseControl](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n`set``Expand``Button(button)` \nSets the [Button](/apps-script/reference/card-service/button) that is displayed for \"show more\" button. Optional. \n\nMust be set together with collapse button.\n\n```javascript\nconst expandButton =\n CardService.newTextButton().setText('Expand');\n\nconst collapseControl =\n CardService.newCollapseControl()\n .setExpandButton(expandButton);\n```\n\nParameters\n\n| Name | Type | Description |\n|----------|------------------------------------------------------|---------------------------|\n| `button` | [Button](/apps-script/reference/card-service/button) | The expand button to set. |\n\nReturn\n\n\n[CollapseControl](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n`set``Horizontal``Align(horizontalAlignment)` \nSets the [HorizontalAlignment](/apps-script/reference/card-service/horizontal-alignment) of the [CollapseControl](#). Optional. \\*\n\n```javascript\nconst collapseControl = CardService.newCollapseControl().setHorizontalAlign(\n CardService.HorizontalAlignment.START,\n);\n```\n\nParameters\n\n| Name | Type | Description |\n|-------------------------|---------------------------------------------------------------------------------|---------------------------------------------------------|\n| `horizontal``Alignment` | [HorizontalAlignment](/apps-script/reference/card-service/horizontal-alignment) | The horizontal alignment of the CollapseControl widget. |\n\nReturn\n\n\n[CollapseControl](#) --- This object, for chaining."]]