type

GridBox

src @Js
class GridBox : Box

GridBox lays its children out in a two dimensional grid.

See also: docDomkit

constructors

fields

halign

How grid content is aligned horizontally against left-over space.

methods

addRow

Add a new row to grid.

cellStyle

Set style for cells.

insertRowBefore

Insert row before given index.

numRows

The number of rows in this GridBox.

removeAllRows

Remove all rows of cells for this GridBox.

removeRow

Remove the row of cells at given index.

rowIndexOf

Return the row index that this child exists under, or null if child was not found in this GridBox.

Slot Details

addRow

src This addRow(Elem?[] cells, Int[] colspan := Int#.emptyList())

Add a new row to grid.

cellStyle

src This cellStyle(Obj col, Obj row, Str style)

Set style for cells. Valid values for col and row:

  • Specific index (0, 1, 2, etc)
  • Range of indexes (0..4, 7..<8, etc)
  • "*": apply to all row or columns
  • "even": apply only to even row or columns indexes
  • "odd": apply only to odd row or column indexes

halign

src Align halign := Align.left

How grid content is aligned horizontally against left-over space. Valid values are left, right, center, or fill.

insertRowBefore

src This insertRowBefore(Int index, Elem?[] cells, Int[] colspan := Int#.emptyList())

Insert row before given index.

make

src new make()

numRows

src Int numRows()

The number of rows in this GridBox.

removeAllRows

src This removeAllRows()

Remove all rows of cells for this GridBox.

removeRow

src This removeRow(Int index)

Remove the row of cells at given index.

rowIndexOf

src Int? rowIndexOf(Elem child)

Return the row index that this child exists under, or null if child was not found in this GridBox.