- Index
- »
- haystack
- »
- GridBuilder
type
GridBuilder
GridBuilder is used to build up an immutable Grid
. To use first define your cols via addCol
and then add the rows via addRow
:
gb := GridBuilder() gb.addCol("a").addCol("b") gb.addRow(["a-0", "b-0"]) gb.addRow(["a-1", "b-1"]) grid := gb.toGrid
methods
addCol |
Add column to the grid. |
---|---|
addColNames |
Add list of column names to the grid. |
addDictRow |
Add dict as a new row to the grid. |
addDictRows |
Convience for adding a list of |
addGridRows |
Add all the rows of given grid as rows to our grid |
addRow |
Add list of cells as a new row to the grid. |
numCols |
Number of columns added to the grid |
numRows |
Number of rows added to the grid |
setMeta |
Set the grid meta (overwrites any current meta) The meta parameter can be any |
toGrid |
Construct to finalized grid |
Slot Details
addCol
This addCol(Str name, Obj? meta := null)
Add column to the grid. The meta parameter can be any Etc.makeDict
value.
addColNames
addDictRow
addDictRows
This addDictRows(Dict?[] rows)
Convience for adding a list of addDictRow
.
addGridRows
addRow
numCols
Int numCols()
Number of columns added to the grid
numRows
Int numRows()
Number of rows added to the grid
setMeta
Set the grid meta (overwrites any current meta) The meta parameter can be any Etc.makeDict
value.
toGrid
Grid toGrid()
Construct to finalized grid