Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Enric Lafont on Jan 31, 2008 06:14
open dhtmlx forum
Row data

I'm trying to recover the values of the columns in a row when the user double clicks on a row, and I'm not able to find nothing interesting to do it, the only way I have found is

function doOnRowSelected(id) {
var myCols=mygrid.rowAr[id].childNodes;
for (i=0; i<3; i++) {
Do_whatever_you_want( myCols[i].innerHTML);
}
}


My question is, does I really need to go to the inner properties of mygrid to get the value of the columns ? There are any other more correct and elegant method to do it ?

I've been looking through the documentation but could find nothing about accessing columns values.

Any answer is welcome.
Answer posted by Support on Jan 31, 2008 06:16
The correct way is

function doOnRowSelected(id) {
    for (i=0; i<3; i++)
        Do_whatever_you_want( mygrid.cells(id,i).getValue());
}

or

function doOnRowSelected(id) {
   mygrid.forEachCell(id,function(c){
        Do_whatever_you_want(c.getValue());
    });
}