简体   繁体   English

将ID添加到ag-grid行

[英]Adding ID to ag-grid row

I would like to identify the div s representing the rows of my ag-grid . 我想识别代表我的ag-grid行的div

What I've tried: 我尝试过的:

onGridReady(params) {
  this.gridApi = params.api;
  this.gridApi.forEachNode(rowNode => {
    rowNode.setId('opo-item-index-'+rowNode.data.lineIndex);
    rowNode.id = 'opo-item-index-'+rowNode.data.lineIndex;
  });
}

Neither of those has worked. 这些都没有奏效。 Is there any other way to achieve this? 有没有其他方法来实现这一目标? The identifier doesn't have to be in id attribute, it could as well be in data-* 标识符不必是id属性,也可以是data-*

Thanks :) 谢谢 :)

您只需在设置ID后重绘行

this.gridApi.redrawRows({rowNode})

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

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