DataGrid Selected Row, Obtain Values?

1401
2
08-20-2012 11:14 AM
PaulVepraskas
Occasional Contributor
I am using a datagrid to get search results.  I want to be able to pull off the cell values when a user selects a row.

<table dojotype="dojox.grid.DataGrid" jsid="grid" id="grid" onSelected="onSelectedGridParm" selectionMode="single" >
         <thead>
            <tr>
              <th field="FieldOne" formatter="makeZoomButton" width="25px">
                <img alt="+" src="images/zoom.png"/>
              </th>
              <th field="FieldTwo" width="100%">FieldTwo</th>
              <th field="FieldThree" width="100%">FieldThree</th>
              <th field="FieldFour" width="100%">FieldFour</th>
              <th field="FieldFive" width="100%">FieldFive</th>
              <th field="FieldSix" width="100%">FieldSix</th>
              <th field="FieldSeven" width="100%">FieldSeven</th>
            </tr>
          </thead>
        </table>


So when a user selects one of the rows in the grid I would like to end up with each cell in that row broken out into its own variable.

 function onSelectedGridParm(nRow) {
            var FieldTwoValue= dijit.byId("grid").store.getValues(nRow, "FieldTwo");
            var FieldThreeValue= dijit.byId("grid").store.getValues(nRow, "FieldThree");
            var FieldFourValue= dijit.byId("grid").store.getValues(nRow, "FieldFour");
            var FieldFiveValue= dijit.byId("grid").store.getValues(nRow, "FieldFive");                      


        }


I have been running around in circles, any help would be appreciated Thanks!

Paul
0 Kudos
2 Replies
MarkReidy
New Contributor II
Hi,
   Look at the onRowClickHandler method in the 'find results in a datagrid' sample under the 'Find and Identify' group.
0 Kudos
PaulVepraskas
Occasional Contributor
Hi,
   Look at the onRowClickHandler method in the 'find results in a datagrid' sample under the 'Find and Identify' group.



Thanks! That was the direction i needed.
0 Kudos