Table

Overview

Creates a table view to place UI elements into a column and row grid system. It also provides the ability to highlight rows, columns and allow users to move items up or down.

Ancestors

  1. Control
  2. Container
 

Descendants

  1. None
 

See Also

  1. None

Members

alternatingColors
Description

Gets or sets whether a table will have alternating colors or not. The alternating colors default to system values.

Definition

boolean table.alternatingColors
columnsCanBeResized
Description

Gets or sets whether the columns can be resized by the user.

Definition

boolean table.columnsCanBeResized (default true)
emptySelection
Description

Gets or sets whether no items are allowed to be selected, the default value is true. Note that if set to false, and no item is selected use selectedRows to specify a default selection. This only prevents the user for deselecting an item it does not prevent no items from being selected.

Definition

boolean table.emptySelection
multipleSelection
Description

Gets or sets whether multiple items can be selected, the default value is true.

Definition

boolean table.multipleSelection
numberOfColumns
Description

Gets the number of columns in the table.

Definition

number table.numberOfColumns
numberOfRows
Description

Gets the number of rows in the table.

Definition

number table.numberOfRows
rowHeight
Description

Gets or sets the height of the rows by pixel value. Note that setting this will override the value of rowHeightStyle.

Definition

number table.rowHeight
rowHeightStyle
Description

Gets or sets the height of the row based on user preferences and system recommendations, this can be either "default", "small", "medium" or "large". Note that this will override the value of rowHeight.

Definition

string table.rowHeightStyle
selectedRows
Description

Gets or sets an array of the rows that are selected. The array contains the indexes of all the rows selected.

Definition

array table.selectedRows
spaceX
Description

Gets or sets the horizontal intercell spacing between cells in logical pixels. The default value depends on the native OS defaults.

Definition

number table.spaceX
spaceY
Description

Gets or sets the vertical intercell spacing between cells in logical pixels. The default value depends on the native OS defaults.

Definition

number table.spaceY

Methods

addColumn(columnName)
Description

Adds a new column to the table, the columns name is used in the header's label, and uniquely identifies the column in the table (regardless if its moved by a user).

Definition

table.addColumn(columnName)
Parameters
NameTypeDescription
columnName string The name used for identifying the column and the label used in the header.
addRow(rowIndex)
Description

Appends a new row to the end of the table, if a index is passed in the row is added at that location.

Definition

table.addRow(rowIndex)
Parameters
NameTypeDescription
rowIndex number A positive whole number that represents the index to add a row at, if nothing is passed for this value the row is appended to the end of the table.
moveColumn(fromIndex, toIndex)
Description

Moves the column specified by fromIndex to the location specified by toIndex.

Definition

table.moveColumn(fromIndex, toIndex)
Parameters
NameTypeDescription
fromIndex number A positive whole number that represents the column's index to move from.
toIndex number A positive whole number that represents the column's index to move to.
moveRow(fromIndex, toIndex)
Description

Moves the row specified by fromIndex to the location specified by toIndex.

Definition

table.moveRow(fromIndex, toIndex)
Parameters
NameTypeDescription
fromIndex number A positive whole number that represents the row's index to move from.
toIndex number A positive whole number that represents the row's index to move to.
removeColumn(columnName)
Description

Removes the column specified by the name passed in (or the headers label).

Definition

table.removeColumn(columnName)
Parameters
NameTypeDescription
columnName string The name used for identifying the column and the label used in the header.
removeRow(rowIndex)
Description

Removes the last row in the table, if an index is passed in the specified row is removed.

Definition

table.removeRow(rowIndex)
Parameters
NameTypeDescription
rowIndex number A positive whole number that represents the index to remove.
setColumnWidth(columnName, width)
Description

Resizes a column's width to the specified width passed in.

Definition

table.setColumnWidth(columnName, width)
Parameters
NameTypeDescription
columnName string The name of the column (or header's label).
width number A positive whole number that represents the logical pixel width of the column.
setValueAt(columnName, rowIndex, control)
Description

Set the value of the specified cell at the column indicated by columnName, and the row indicated by rowIndex. The value can be either a user interface control string.

Definition

table.setValueAt(columnName, rowIndex, control)
Parameters
NameTypeDescription
columnName string The name of the column (or header's label).
rowIndex number A positive whole number that represents the rows index.
control Control Control to render at the specified row and column. This can be either a string, or any user interface control.
setValueAt(columnName, rowIndex, text)
Description

Set the value of the specified cell at the column indicated by columnName, and the row indicated by rowIndex. The value can be either a user interface control string.

Definition

table.setValueAt(columnName, rowIndex, text)
Parameters
NameTypeDescription
columnName string The name of the column (or header's label).
rowIndex number A positive whole number that represents the rows index.
text string Text to render at the specified row and column. This can be either a string, or any user interface control.

Events

column-clicked
Description

Fires when the user clicks a column (e.g., after any processing has occured).

Definition

table.addEventListener('column-clicked', function() { ... });
column-mousedown
Description

Fires when the user begins to click a column but prior to any processing.

Definition

table.addEventListener('column-mousedown', function() { ... });
row-added
Description

Fires when a new row is added to the table by the user or programmatically.

Definition

table.addEventListener('row-added', function() { ... });
row-removed
Description

Fires when a row is removed form the table by the user or programmatically.

Definition

table.addEventListener('row-removed', function() { ... });
select
Description

Fires when the selected rows change by the user or programmatically. This fires prior to the selection actually changing.

Definition

table.addEventListener('select', function() { ... });
selected
Description

Fires when the selected rows change by the user or programmatically. This fires after the selection has changed.

Definition

table.addEventListener('selected', function() { ... });