Class CardSection

CardSection

A card section holds groups of widgets and provides visual separation between them.


 var image = CardService.newImage();
 // Build image ...
 var textParagraph = CardService.newTextParagraph();
 // Build text paragraph ...

 var cardSection = CardService.newCardSection()
     .setHeader("Section header")
     .addWidget(image)
     .addWidget(textParagraph);
 

Methods

MethodReturn typeBrief description
addWidget(widget)CardSectionAdds the given widget to this section.
setCollapsible(collapsible)CardSectionSets whether the section can be collapsed.
setHeader(header)CardSectionSets the header of the section.
setNumUncollapsibleWidgets(numUncollapsibleWidgets)CardSectionSets the number of widgets that are still shown when this section is collapsed.

Detailed documentation

addWidget(widget)

Adds the given widget to this section. Widgets are shown in the order they were added.

Parameters

NameTypeDescription
widgetWidgeta widget to add to the section.

Return

CardSection — this object, for chaining.


setCollapsible(collapsible)

Sets whether the section can be collapsed.

Parameters

NameTypeDescription
collapsibleBooleanthe collapsible setting.

Return

CardSection — this object, for chaining.


setHeader(header)

Sets the header of the section. Optional.

Parameters

NameTypeDescription
headerStringthe header text.

Return

CardSection — this object, for chaining.


setNumUncollapsibleWidgets(numUncollapsibleWidgets)

Sets the number of widgets that are still shown when this section is collapsed. The widgets shown are always the first ones that were added.

Parameters

NameTypeDescription
numUncollapsibleWidgetsIntegerthe number of widgets to show.

Return

CardSection — this object, for chaining.

Send feedback about...

Apps Script
Apps Script