:: Documentation >> Tutorial >> Grid >>

Creating a grid

Adding an ActiveUI grid to the page is very simple. First, create an instance of Active.Controls.Grid class.

var obj = new Active.Controls.Grid;

Then specify a number of columns and number of rows.

obj.setProperty("column/count", 5);
obj.setProperty("row/count", 10);

Provide some data to be displayed inside the cells. 

obj.setProperty("data/text", "some text");

And finally write the HTML to the page.

document.write(obj);

Here is the complete script:

Obviously having the same text in each cell doesn't make much sense.  Next section describes how to link the grid to the data source.

Data Binding >>