Highlighting/Selecting grid row in ExtJS

这一生的挚爱 提交于 2019-12-04 05:09:29

There is no getRow method in Ext.grid.GridPanel. However, there is one in Ext.grid.GridView.

To highlight the row you should do the following:

var row = grid.getView().getRow(0); // Getting HtmlElement here
Ext.get(row).highlight(); // Getting element wrapper and using its "highlight" method

To perform row selection you are using grid's SelectionModel:

grid.getSelectionModel().selectRow(0)

Component: Ext.grid.Panel

Version: 4.0.0

To select one item and remove previous selection:

grid.getSelectionModel().select(0);

To select one item and keep previous selection:

grid.getSelectionModel().select(0, true);

To select a row at a particular index, use the selection model.

Ext.grid.GridPanel.getView().getSelectionModel().select(index);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!