Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Nov 21, 2007 23:25
open dhtmlx forum
How to get specific row/cell data from grid

i have the following xml data, i want to get all the data of the row with id="1a",how to do it without selecting any rows/cells on the grid? thanks!


<?xml version="1.0" encoding="UTF-8"?>
<rows>
<head>

    <column name="row1" width="170" type="ro" align="center" sort="str">ID</column>
    <column width="90" type="ed" align="center" color="red" sort="str">Code Type</column>
    <column width="90" type="ed" align="center" color="yellow" sort="str">Code</column>
.....
.......

    <settings>
        <colwidth>px</colwidth>
    </settings>
    
</head>

    <row id="1a" >
        <cell>232</cell>
        <cell>BLISTRAY</cell>
        <cell>BIT1</cell>
...
....
    </row>
.....
.....
Answer posted on Nov 22, 2007 01:53
In common case, you can get cell data as

    grid.cells(id,index).getValue()

where id - row ID
           index - index of column

if you need to get all data from row

var data=[];
grid.forEachCell(id,function(c){
    data.push(c.getValue());
});

where id - row ID