Class Column

Column

A Sites Column - a column from a Sites List page.

Methods

MethodReturn typeBrief description
deleteColumn()voidDeletes this column.
getName()StringGets the name of this column.
getParent()PageReturns the List Page this column belongs to.
setName(name)ColumnSets the name of this column.

Detailed documentation

deleteColumn()

Deletes this column.

var page = SitesApp.getSite('example.com', 'mysite').getChildByName('mylistpage');
var columns = page.getColumns();
columns[0].deleteColumn();

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://sites.google.com/feeds

getName()

Gets the name of this column.

var page = SitesApp.getSite('example.com', 'mysite').getChildByName('mylistpage');
var columns = page.getColumns();
var name = columns[0].getName();

Return

String — the column name

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://sites.google.com/feeds

getParent()

Returns the List Page this column belongs to.

var page = SitesApp.getSite('example.com', 'mysite').getChildByName('mylistpage');
var columns = page.getColumns();

// This returns a reference to page
var parentPage = columns[0].getParent();

Return

Page — the page this column belongs to

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://sites.google.com/feeds

setName(name)

Sets the name of this column.

var page = SitesApp.getSite('example.com', 'mysite').getChildByName('mylistpage');
var columns = page.getColumns();
columns[0].setName("New Name");

Parameters

NameTypeDescription
nameStringthe new name

Return

Column — this Column for chaining

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://sites.google.com/feeds