new ludo.layout.Grid(config)

This layout arranges child views in a grid layout. It is similar to the Table Layout, but a bit simpler.
It creates a coordinate system based on given number of columns and rows. All the columns has the
same width, and all rows has the same height. You position child views inside the coordinate system
by specifying a value for x and y. Child views can also span multiple columns and/or rows using
the colspan and rowspan attribute.

Spacing between columns and rows are controlled by the padX and padY attribute.

For demo, see Grid layout demo.

Name Type Description
config object
Name Type Description
columns Number

Number of columns

rows Number

Number of rows

padX Number

Optional horizontal spacing between columns

padY Number

Optional vertical spacing between columns

x Number

Parameter for child view, x coordinate, 0 = first column.

y Number

Parameter for child view, y coordinate, y = first row.

colspan Number

Parameter for child view. Span these many columns, default = 1

rowspan Number

Parameter for child view. Span these many rows, default = 1