javascript - 滚动移动时,Ag-grid 在整个列中复制 CellStyle
问题描述
我有以下代码:
const cell = vm.gridOptionsFib.api.setFocusedCell(index, field, null);
const cellFoc = vm.gridOptionsFib.api.getFocusedCell();
const rowNodeCell = vm.gridOptionsFib.api.getRowNode(cellFoc.rowIndex);
const column = cellFoc.column.colDef.field;
cellFoc.column.colDef.cellStyle = { 'backgroundColor': 'rgba(233, 30, 99, 0.3)' };
vm.errGrid = "mensaje tooltip";
cellFoc.column.colDef.tooltipValueGetter = function() {return vm.errGrid;};
vm.gridOptionsFib.api.refreshCells({force: true, columns: [column], rowNodes: [rowNodeCell]});
vm.gridOptionsFib.api.clearFocusedCell();
这很好用并标记了我指定的单元格,当我移动水平滚动条时出现问题,当我返回指定的列时,它会在我只指定一个时绘制所有单元格。
有谁知道它为什么这样做或者我需要一些指导。
解决方案
如果有人遇到同样的问题,应用的解决方案是在 gridOptions 中设置以下属性。
suppressColumnVirtualisation: true,
rowBuffer: 9999,
推荐阅读
- java - Spring 中的 Apache Camel 可以从 Kafka 获取以前的消息吗?
- c - 将 .asm 文件中的外部汇编函数包含到 .h C 头文件中
- python - 来自 scipy.integrate.ode 积分器 dopri5(Python)的意外结果
- c++ - Ceres-solver 给出错误的三边形结果
- git - 如何在 Jenkins 中构建时打印 GitLab 合并请求 ID
- github - 在没有蓝色图标的gitlab中评论多行?
- jenkins - Jenkins 管道如何检测来自所有 mercurial 分支的更改
- r - 如何检测数据帧单元格中的模式并使用 R 将它们转换为 NA?
- postgresql - 无法连接到 Kubernetes 集群上的远程 postgreSQL 数据库
- printing - awk 包括当前日期作为文件中的最后一列,并将内容打印为列分隔