Class CardSection | Apps Script | Google for Developers (original) (raw)
CardSection
カード セクションにはウィジェットのグループが保持され、それらのグループが視覚的に分離されます。
Google Workspace アドオンと Google Chat アプリで利用できます。
const image = CardService.newImage(); // Build image ... const textParagraph = CardService.newTextParagraph(); // Build text paragraph ...
const cardSection = CardService.newCardSection() .setHeader('Section header') .addWidget(image) .addWidget(textParagraph);
詳細なドキュメント
setCollapseControl(collapseControl)
セクションのカスタマイズ可能な開閉ボタンを設定します。これらのボタンは、セクションが折りたたみ可能な場合にのみ表示されます。このフィールドが設定されていない場合、デフォルトのボタンが使用されます。
Google Chat アプリで利用できます。Google Workspace アドオンのデベロッパー プレビュー版です。
const collapseButton = CardService.newTextButton() .setTextButtonStyle(CardService.TextButtonStyle.BORDERLESS) .setText('show less');
const expandButton = CardService.newImageButton() .setImageButtonStyle(CardService.ImageButtonStyle.FILLED) .setMaterialIcon(CardService.newMaterialIcon().setName('bug_report'));
const collapsibleSection = CardService.newCardSection() .setCollapsible(true) .setNumUncollapsibleWidgets(1) .setCollapseControl( CardService.newCollapseControl() .setHorizontalAlign(CardService.HorizontalAlignment.CENTER) .setCollapseButton(collapseButton) .setExpandButton(expandButton), );
パラメータ
| 名前 | 型 | 説明 |
|---|---|---|
| collapseControl | CollapseControl | 折りたたみコントロールの設定。 |
戻る
[CardSection](#) - チェーン用のこのオブジェクト。
setCollapsible(collapsible)
セクションを折りたたむことができるかどうかを設定します。
パラメータ
| 名前 | 型 | 説明 |
|---|---|---|
| collapsible | Boolean | 折りたたみ可能な設定。 |
戻る
[CardSection](#) - チェーン用のこのオブジェクト。
setId(id)
変更するセクションの識別に使用される、割り当てられた一意の ID を設定します。セクションの変更はアドオンでのみサポートされています。
パラメータ
| 名前 | 型 | 説明 |
|---|---|---|
| id | String | セクションの ID。64 文字以内で、`[a-zA-Z0-9-]+` の形式で指定します。 |
戻る
[CardSection](#) - チェーン用のこのオブジェクト。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-12-03 UTC。