:: Forum >>

Grid Help Needed - Can't see grid

I'm trying to follow the grid examples but when I put the code into my own .php file I don't see the grid component.

Here is my code so far:

var num = new AW.Formats.Number;
num.setTextFormat("#,###.");
var myData = [
[1, "World", 1018057389, 2005, "world"],
[2, "European Union", 247000000, 2006, "eu"],
[3, "United States", 205326680, 2005, "us"],
[4, "China", 123000000, 2006, "cn"],
[5, "Japan", 86300000, 2005, "jp"],
[6, "India", 60000000, 2005, "in"],
[7, "Germany", 50616000, 2006, "de"],
[8, "United Kingdom", 37600000, 2005, "gb"],
[9, "Korea South", 33900000, 2005, "kr"],
[10, "France", 29945000, 2006, "fr"] // no comma in the last line
];
var myHeaders = ["Rank", "Country", "Internet users", "Data from"];

var grid = new AW.UI.Grid;
grid.setId("grid1");
grid.setHeaderText(myHeaders);
grid.setCellData(myData);
grid.setCellFormat(num, 2);
grid.setColumnCount(4);
grid.setRowCount(10);
grid.refresh();
Ralph F
Friday, August 8, 2008
You are probably missing a placeholder element with the same id as the grid, for example -

<span id="grid1"></span>
Alex (ActiveWidgets)
Monday, August 11, 2008

This topic is archived.


Back to support forum

Forum search