:: Documentation >> Tutorial >> Grid >>

Linking grid to a javascript array.

In a more realistic example the grid data is stored in a two-dimensional javascript array. Instead of providing a static text to the grid - you should supply the function, which just returns an array element for a given row and column indices.

obj.setProperty("data/text", function(i,j){return myData[i][j]});

Example:

Loading data from a text file >>