Iterating through the datatable

Hi,

I dynamically create column ids in a datatable and am trying to access the values as per below example for a 2 x 2 table:

  for(var i=0;i<2;i++)
  {
     var colid = $$('grid').columnId(i);
     for(var j=1;j<2;j++)
     {
        var iRow = $$('grid').getItem(j);
        alert(iRow.colid); //getting undefined
     }
  }

Your help is appreciated. Thanks

Ashok

Sorry, I corrected this by alert(iRow[colid]).

Ashok