Ag-Grid:如何获得集中的单元格值 [英] Ag-Grid : How to get the focused cell value
本文介绍了Ag-Grid:如何获得集中的单元格值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在使用键盘上的箭头键将时间集中在单元格上时获得聚焦的单元格值
How to get the focused cell value at the time focussing on the cell by using the keyboard arrow keys
推荐答案
通过使用
var focusedCell = gridOptions.api.getFocusedCell();
或使用 onCellFocused 事件。
两者都为您提供以下属性:
Both give you the following properties:
- rowIndex:数字
- 列:列
使用行索引检索行节点:
Use the row-index to retrieve the row-node:
var row = gridOptions.api.getDisplayedRowAtIndex(rowIndex);
之后,您可以使用这些属性来检索单元格的原始值:
After that you can use those properties to retrieve the raw value of the cell:
var cellValue = gridOptions.api.getValue(colKey, row.node)
这篇关于Ag-Grid:如何获得集中的单元格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文