Ext JS网格获得最后一个选定行的dom [英] Ext JS grid get dom of last selected row
本文介绍了Ext JS网格获得最后一个选定行的dom的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有机会获得网格中最后选定的行的 DOM
值。我只能使用值而不是 DOM
元素获取记录。使用 DOM
元素我的意思是所选行的< tr>
元素。
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
推荐答案
您可以使用网格的视图 getNode()
方法。它返回网格记录行的HTMLElement。如果要使用行HTML元素执行某些操作,可以使用 Ext.get()
方法获取 Ext.dom.Element
对象。
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);
这篇关于Ext JS网格获得最后一个选定行的dom的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文