Grid Row ID problem
When I use the syntax as described in http://www.activewidgets.com/javascript.forum.7821.6/assigning-my-own-rowid-to.html, Internet Explorer returns an syntax-error. The grid doesn't load because of this error.
This is the code:
I'm using the yesterday released version 2.0. What's wrong?
This is the code:
var myData = [];
myData["111"] = ["MSFT","Microsoft Corporation", "314,571.156", "32,187.000"];
myData["222"] = ["ORCL", "Oracle Corporation", "62,615.266", "9,519.000"];
myData["333"] = ["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420"];
myData["444"] = ["CA", "Computer Associates Inter", "15,606.335", "3,164.000"];
myData["555"] = ["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727"];
];
// create ActiveWidgets Grid javascript object
var grid = new AW.UI.Grid;
grid.setStyle('width','99.5%')
grid.setStyle('height','350px')
grid.setVirtualMode(false);
// provide cells and headers text
grid.setCellText(myData);
grid.setHeaderText(myColumns);
grid.setRowIndices(["111"]);
// define data formats
var str = new AW.Formats.String;
var num = new AW.Formats.Number;
var dat = new AW.Formats.Date;
dat.setTextFormat("dd-mm-yyyy")
grid.setCellFormat([str, str, str, str, dat, dat, str, str, str, str]);
// set number of rows/columns
grid.setColumnCount(9);
grid.setRowCount(<%=i%>);
// set headers width/height
grid.setHeaderHeight(20);
// set editable on/off
grid.setCellEditable(false);
// enable row selectors
grid.setSelectorVisible(true);
grid.setSelectorWidth(30);
grid.setSelectorText(function(i){return this.getRowPosition(i)+1});
// set row selection
grid.setSelectionMode("single-row");
document.write(grid);
I'm using the yesterday released version 2.0. What's wrong?
Laurens
February 2,