[英]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. 是否有机会获得网格内最后选定行的DOM
值。 I could only get the record with values and not the DOM
elements. 我只能使用值而不是DOM
元素来获取记录。 With DOM
elements I mean the <tr>
element of the row selected. 对于DOM
元素,我的意思是所选行的<tr>
元素。
var selectedRecord = grid.getSelectionModel().getLastSelected();
//only gets the model instance that is selected //仅获取选定的模型实例
You can use grid's view getNode()
method. 您可以使用网格的视图getNode()
方法。 It returns HTMLElement of the grid record's row. 它返回网格记录行的HTMLElement。 If you want to do something with row HTML element you can use Ext.get()
method to obtain Ext.dom.Element
object. 如果要对行HTML元素执行某些操作,可以使用Ext.get()
方法获取Ext.dom.Element
对象。
// selected record
var selectedRecord = grid.getSelectionModel().getLastSelected();
// row HTMLElement
var node = grid.view.getNode(selectedRecord);
// Ext.dom.Element object
var el = Ext.get(node);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.