PDA

View Full Version : selected row element



iamleppert
7 Aug 2007, 3:14 PM
How do I get the selected row's DOM element of a grid's RowSelectionModel? getSelected() returns a record object and I tried the YUI grid.getSelectedRow() but for some reason that function isn't available in grid.

Thanks,

Johnathan

iamleppert
8 Aug 2007, 3:28 PM
anyone? still can't figure it out :(

evant
8 Aug 2007, 3:29 PM
What are you trying to achieve exactly?

dnixon
8 Aug 2007, 3:58 PM
This gets a particular grid cell DOM node (not mine, I copied this from Animal's post in http://extjs.com/forum/showthread.php?t=5972):


Ext.DomQuery.selectNode("#" + gridId + " .x-grid-viewport .x-grid-body tbody").rows[rowNumber].cells[cellNumber];

Not sure what you get if you omit the ".cells[cellNumber]" part.

vendiddy
24 Nov 2007, 9:22 AM
Hi, I was trying to do the same thing you were because I wanted to animate a dialog box from the row that was double clicked on. Here is my code:



var handleRowDblClick = function(grid, rowIndex, e) {
var record = grid.getSelections()[0].data;
var rowElem = e.target;
while (rowElem.tagName != 'TR') {
rowElem = rowElem.parentNode;
}
dlg.show(rowElem);
}


Don't know if it's the best way, but it seems to work.