简体   繁体   English

使用ext js 4.1突出显示网格中的一行

[英]highlight a row in grid using ext js 4.1

I'm trying to highlight a row and I've googled for a while however all solutions use functions that don't even exist such as getRow() or highlight() . 我正在尝试突出显示行,并且已经搜索了一段时间,但是所有解决方案都使用了甚至不存在的函数,例如getRow()getRow() highlight()

Does anyone have a solution for it? 有人对此有解决方案吗? I've tried the above and the getView().select(record) Neither has worked 我已经尝试了上面的和getView().select(record)都没有工作

Thanks 谢谢

选择行就足够了吗?

gridPanel.getSelectionModel().select([recordToSelect]);

You can use the rowClass to modify a row based on record conditions. 您可以使用rowClass根据记录条件修改行。

yourGrid.getView().getRowClass = function(record, rowIndex, rowParams, store){ 
     return record.get('status').toLowerCase(); // class selection condition
}

See the JSFiddle example for this ( very basic example, just show that the row class get ressetted after each change of the record. ) 为此 ,请参见JSFiddle示例( 非常基本的示例,仅显示在每次更改记录后都会重置行类。

grid.getSelectionModel().select(0)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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