Home Reference Source
import {Grid} from 'infamous/src/legacy/Grid.js'
public class | source

Grid

Extends:

* → Grid

A scenegraph tree with a variable number of leaf node Modifiers (the grid cells) that are arranged in a grid. Add any famous/src/core/RenderNode-compatible item to each leafnode of the grid.

TODO: Use Molecule instead of Modifier for the grid cells. TODO: Add an options parameter, that the Molecule constructor will handle.

Constructor Summary

Public Constructor
public

constructor(columns: Number, rows: Number, size: Array)

Creates a new Grid having the specified number of columns, number of rows, and famo.us-style size.

Member Summary

Public Members
public

cellNodes: *[]

public

columns: *

public

rows: *

Method Summary

Public Methods
public

setChildren(children: Array): *

Sets the items to be layed out in the grid.

Private Methods
private

Creates a grid cell at the given index.

Public Constructors

public constructor(columns: Number, rows: Number, size: Array) source

Creates a new Grid having the specified number of columns, number of rows, and famo.us-style size.

Params:

NameTypeAttributeDescription
columns Number

The integer number of columns.

rows Number

The integer number of rows.

size Array

A famo.us-style width/height size array.

Public Members

public cellNodes: *[] source

public columns: * source

public rows: * source

Public Methods

public setChildren(children: Array): * source

Sets the items to be layed out in the grid.

Params:

NameTypeAttributeDescription
children Array

An array of famous/src/core/RenderNode-compatible items.

Return:

*

Private Methods

private _createGridCell(index: Number) source

Creates a grid cell at the given index.

Params:

NameTypeAttributeDescription
index Number

The integer index of the grid cell.