Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Namrta on Oct 15, 2008 09:30
open dhtmlx forum
storing grid values in array

Hi,

I am trying the standard version of DHTMLXGrid. I am able to load xml into grid but the problem is that now I want to store some column's cell's values in an array. For example I have 5 columns in grid, out of which 2 columns are of type "ro" and rest 3 are of type "ed" now after making some changes i want all "ed" data to be stored in 3 arrays, so that i can retrieve there values in any other file in the application. Is this possible with this grid, if yes then please reply ASAP.
Answer posted by Support on Oct 15, 2008 10:00
The data of cells may be accessed as 
    grid.cells(i,j).getValue();

In your case next code probably will be useful

var data1=[];
var data2=[];
var data3=[];

grid.forEachRow(function(id){
     data1.push(grid.cells(id,2).getValue());
     data2.push(grid.cells(id,3).getValue());
     data3.push(grid.cells(id,4).getValue());
});