angular - 有没有如何在 AG-GRID 上显示行时获取行?
问题描述
我很难在 ag-grid 上实现 MOVE-TO 功能。
目标是在外部输入文本上按 enter 后跳转到可见单元格。
目前我正在调用 forEachNodeAfterFilterAndSort 来检索正在显示的行。但是当你开始处理组、orgHierachy、隐藏列等时,事情就没有那么简单了。
那么,有没有办法在 ag-grid api 上获得类似的东西?
例如
_________________
| A | B |
-----------------
0)| Loris | Ipsum |
1)| | foo |
2)| | bar |
-----------------
GetRowsAsTheyREALLY 是:
[
{index:0, A='Loris', B="Ipsum"},
{index:1, B="foo"},
{index:2, B="bar"}
]
解决方案
根据 Ag- getDisplayedRowCount();
Gird 文档用于获取可见行。
前任
getAllDisplayedRows() {
var count = this.gridApi.getDisplayedRowCount();
for (var i = 0; i < count; i++) {
var rowNode = this.gridApi.getDisplayedRowAtIndex(i);
console.log("row " + i + " is " + rowNode.data);
}
}
读这个
推荐阅读
- web-scraping - 网页抓取某些网站不起作用
- three.js - 我的浏览器中的这个标记是什么……是 gltf 吗?
- flutter - Flutter & Provider 自动登录
- python - Python datetime问题转换时间格式
- opengl - Mapbox GL Native 不构建 ubuntu18
- javascript - 如何在函数返回中向对象添加多个数组?
- css - 展开菜单项时侧边栏不会滚动到底部
- python - OpenCV:计算从轮廓点到 pygame 对象的距离失败
- nativescript - 是否可以一键关闭应用程序?
- javascript - 将 AdminLTE 与 MVC 5 应用程序集成