:: Forum >>

Grid Row ID problem

When I use the syntax as described in /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:
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;

    // provide cells and headers text

    // define data formats
    var str = new AW.Formats.String;
    var num = new AW.Formats.Number;
    var dat = new AW.Formats.Date;

    grid.setCellFormat([str, str, str, str, dat, dat, str, str, str, str]);
    // set number of rows/columns

    // set headers width/height
    // set editable on/off
    // enable row selectors
     grid.setSelectorText(function(i){return this.getRowPosition(i)+1});
    // set row selection


I'm using the yesterday released version 2.0. What's wrong?
Thursday, February 2, 2006
Found it. It was the accidentally placed ]; after the myData definition.
Thursday, February 2, 2006
Do you provide indices for all rows? Is RowCount correct? The example above should look like

grid.setRowIndices(["111", "222", "333", "444", "555"]);

Also note that index could contain only digits (0-9), other characters are not allowed.
Alex (ActiveWidgets)
Thursday, February 2, 2006
ok, too late :-)
Alex (ActiveWidgets)
Thursday, February 2, 2006
Thanks for your fast reply! But... there is another problem. I used to fill the myDate array without row ID's:

var myData =
["MSFT","Microsoft Corporation", "314,571.156", "32,187.000"],
["ORCL", "Oracle Corporation", "62,615.266", "9,519.000"],

I could select a row and activate a function when doing so. Now I use the other format (with Row ID's) I can't select a row anymore by clicking on it! I use the following function:

// on select row open record
    grid.onSelectedRowsChanged = function(row){
        nr = grid.getCellValue(1,row)

Last but not least... can you please hava a look at my other post?

Thursday, February 2, 2006

This topic is archived.

Back to support forum

Forum search