dojodojox.griddojox.grid.datagrid

dojox.enhancedGrid get Selected Row


How can I get the Selected Row Object of dojox.enhancedGrid ? I am using selectionMode: 'single' e.g. with Radio Buttons.

dijit.byId("gridViewWidget").selection.selectedIndex Returns the rowIndex. But how to get the rowObject of that Index ? I can get the rowNode()But What I need is value of the id column of that Row.

Its possible to travarse the HTML DOM returned by rowNode() But Is there any straight forward way ?

I am currently using dijit.byId("gridViewWidget").store._dataArray[i] and passing the returned index. Though This works it seems _dataArray is a private property. So Is it safe to use ?


Solution

  • I'm new to dojo myself, but this should be useful if not entirely correct. First of all, dojox.grid.enhancedGrid is built on top of dojox.grid.DataGrid, so check out the documentation here:

    dojox.grid.DataGrid Documentation

    You should be able to use either of these to get the item you want.