Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jans on Jun 13, 2008 08:25
open dhtmlx forum
grid : get checked row value

Hi,


We are using struts and JSP. And we need the values of a checked row in the grid.As of now we are using the standard edition.
We are able to get the index of the checked value through :
mygrid.getCheckedRows(0);
But is there a way we can get the values of the row corresponding to that iindex.

For Eg:

Grid
Checkbox | Name | Age |
-------------------------------------
Checkbox1 | Joe | 23 |
Checkbox2 | Jene | 24 |


If checkbox 2 is selected i want the value of the name corresponding to this.

Regards
Janani
Answer posted by Support on Jun 13, 2008 09:37
getCheckedRows returns list of IDs , by knowing ID you can access any data in related row by using
    grid.cells(id,index).getValue()

for example

var ids=mygrid.getCheckedRows(0);
if (ids.length){
    ids=ids.split(",")
    for (var i=0; i<ids.length; ids++)
       alert(grid.cells(ids[i],1).getValue();
}