简体   繁体   中英

Ext JS grid get dom of last selected row

Is there any chance to get the DOM values of the last selected row inside a grid. I could only get the record with values and not the DOM elements. With DOM elements I mean the <tr> element of the row selected.

var selectedRecord = grid.getSelectionModel().getLastSelected();

//only gets the model instance that is selected

You can use grid's view getNode() method. It returns HTMLElement of the grid record's row. If you want to do something with row HTML element you can use Ext.get() method to obtain Ext.dom.Element object.

// selected record
var selectedRecord = grid.getSelectionModel().getLastSelected();

// row HTMLElement
var node = grid.view.getNode(selectedRecord);

// Ext.dom.Element object
var el = Ext.get(node);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM