Reputation: 77
I'm using dojo dataGrid, and i need to get the row id. When i use the "rowIndex" event, i get the "id" of the row, but, if i sort the grid, the data keeps another value in the row "id".
Can someone tell me how to solve this problem ? Thanks
Upvotes: 1
Views: 4907
Reputation: 963
Do you need the row of the grid when selected? Why do you need the row id? Usually I find if I let dojo handle row and data sorting for me and just pull in the selected item when I need it I'm better off.
e.g.
function onSelectedGridParm(nRow){
var objGridParm = dijit.byId("gridParm");
var item = objGridParm.getItem(nRow);
// single select - use an array here for multi select
// and remove in onDeselect
_selectedVariable = item;
fnEnableButton( "VariableEdit" );
fnEnableButton( "VariableDelete" );
}
....
<div id="gridParm" dojoType="dojox.grid.DataGrid"
style="width: 100%; height: 550px;"
structure="layoutVariables"
selectionMode="single"
noDataMessage="No Data Found with current filters"
onSelected="onSelectedGridParm"
onDeselected="onDeselectedGridParm"
rowsPerPage="50"
>
</div>
Upvotes: 1