Loading [MathJax]/jax/output/CommonHTML/config.js
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >无法在ag-grid自定义工具提示中获得行id。

无法在ag-grid自定义工具提示中获得行id。
EN

Stack Overflow用户
提问于 2020-01-09 01:51:20
回答 1查看 347关注 0票数 0

我已经创建了表格,使用ag网格与自定义工具提示和逐行过滤。假设默认网格有4行,行索引如下所示

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
row-index: 0
row-index: 1
row-index: 2
row-index: 3

在过滤行时,行索引每次重置0、1、2.我只想要行id,它是常量的。

如何在ag网格自定义工具提示中获取行id

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
import { Component } from '@angular/core';
import { ITooltipAngularComp } from 'ag-grid-angular';   

@Component({
  selector: 'tooltip-component',
  templateUrl: './ag-grid-tooltip.component.html',
  styleUrls: ['./ag-grid-tooltip.component.scss'],
})
export class AgGridTooltipComponent implements ITooltipAngularComp {

  private params: any;

  public data: string;
  public show: boolean;

  constructor() {

  }

  agInit(params): void {
    this.params = params;
    console.log(this.params.rowIndex); // working fine always starts with 0


   console.log(this.params.rowId); // undefined
console.log(this.params.node.id); // can not read id.



      }
    }
EN

回答 1

Stack Overflow用户

发布于 2020-01-09 02:03:58

您需要像这样实现getRowNodeId函数。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
gridOptions.getRowNodeId = (item) => {
   return item.id;
};
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59661265

复制
相关文章
【6】VScode 无法在终端输入问题,提示:无法在只读编辑器中编辑
2.在设置中输入 run code config 找到里面的 run in terminal 打勾即可,往下滑动几秒就看到了
汀丶人工智能
2022/12/21
7.2K0
【6】VScode 无法在终端输入问题,提示:无法在只读编辑器中编辑
微信小程序开发工具提示 Login 不能获得 ID 的问题解决
这时候,你可用尝试将 cloudfunctions下的login 文件夹创建并部署,安装云依赖。
HoneyMoose
2020/07/11
6610
微信小程序开发工具提示 Login 不能获得 ID 的问题解决
20 多个好用的 Vue 组件库
地址:https://github.com/matfish2/vue-tables-2
唐志远
2022/10/27
7.9K0
20 多个好用的 Vue 组件库
20多个好用的 Vue 组件库,请查收!
Vue Tables 2旨在为开发者提供一个功能齐全的工具集,以便用 Vue 创建漂亮而实用的数据表格。数百个商业软件应用正在使用它。此外,Vue Tables 2正在不断成长、改进,同时也在获得新的功能。
前端小智@大迁世界
2022/04/01
7.7K0
20多个好用的 Vue 组件库,请查收!
Ubuntu“无法获得锁”解决方案(E: 无法获得锁 /var/cache/apt/archive)
[scode type="yellow"]Ubuntu “无法获得锁”解决方案(E: 无法获得锁 /var/cache/apt/archive)[/scode]
乐心湖
2020/07/31
1.8K0
如何获得Docker容器进程ID?
在某些情况下,比如系统负载很高 docker stop 无法关闭某个容器(无响应),这时可以根据容器进程的ID找到宿主机进程ID,然后强制kill掉这个容器,最好已经使用了数据卷保证数据持久化,否则强制关闭容器可能会导致容器内数据丢失(关于数据卷后续专门写一篇文章)。
用户1560186
2019/11/20
5.8K0
PowerBI 工具提示 在图上显示图
很多人会好奇的是,这个页面如何随着其他的图而变呢?其道理在于它会受到其他图的筛选。
BI佐罗
2020/08/20
2.3K0
Power BI DAX自定义工具提示
建一个单独的工具提示度量值,将多个信息整合到一起,此处需要注意有可能文字太长无法完全展示,可使用UNICHAR进行换行。
wujunmin
2022/04/06
1.3K0
Power BI DAX自定义工具提示
怎么在VSCode开发工具中配置GitHub GPT代码提示
总结:要在VSCode中配置GitHub GPT代码提示,首先确保有相应的插件可用。然后,根据插件的要求进行安装和配置。最后,学习如何正确地使用插件来获得自定义的代码提示。具体步骤可能因插件的不同而有所不同,因此请查阅相关插件的文档以获取更具体的指导。
用户2322735
2023/07/28
4030
E: 无法获得锁 /var/lib/dpkg/lock
Ubuntu下很常见的问题,标记一下。 u1@node:~# sudo apt-get install -y mysql-client mysql-server E: 无法获得锁 /var/lib/dpkg/lock - open (11: 资源暂时不可用) E: 无法锁定管理目录(/var/lib/dpkg/),是否有其他进程正占用它? u1@node:~# sudo apt-get install -y mysql-client mysql-server E: 无法获得锁 /var/lib/dpkg/l
程裕强
2022/05/06
4420
Flutter中自定义提示框
1. 弹出提示框 定义模态框组件,代码如下: import 'package:flutter/material.dart'; class MyDialog extends Dialog{ final String title; final String content; // 构造函数赋值 MyDialog({this.title="",this.content=""}); @override Widget build(BuildContext cont
越陌度阡
2021/01/06
1.4K0
ag-grid 学习
项目要将 angular 从 1.5升级到 5,ui-grid 在 5 中并不支持,所以为了替换 ui-grid ,来学习了 ag-grid 。
全栈程序员站长
2022/09/20
2.7K0
ag-grid 学习
JNI|在子线程中获得JNIEnv|AttachCurrentThread
A JNI interface pointer (JNIEnv*) is passed as an argument for each native function mapped to a Java method, allowing for interaction with the JNI environment within the native method.This JNI interface pointer can be stored, but remains valid only in the current thread. Other threads must first call AttachCurrentThread()to attach themselves to the VM and obtain a JNI interface pointer. Once attached, a native thread works like a regular Java thread running within a native method. The native thread remains attached to the VM until it callsDetachCurrentThread() to detach itself.[3]
望天
2019/05/26
1.1K0
Silverlight的自定义tooltip提示工具条
这种应用场景其实很多,比如游戏中装备/魔法的选择菜单,这里借用了"深蓝色右手"的一张图  再比如聊天室中的文本颜色设置  虽然sl的ToolTipService.ToolTip属性可以设置任何对象,比
菩提树下的杨过
2018/01/23
1.3K0
Silverlight的自定义tooltip提示工具条
JNI|在子线程中获得JNIEnv|AttachCurrentThread
A JNI interface pointer (JNIEnv*) is passed as an argument for each native function mapped to a Java method, allowing for interaction with the JNI environment within the native method.This JNI interface pointer can be stored, but remains valid only in the current thread. Other threads must first call AttachCurrentThread()to attach themselves to the VM and obtain a JNI interface pointer. Once attached, a native thread works like a regular Java thread running within a native method. The native thread remains attached to the VM until it callsDetachCurrentThread() to detach itself.[3]
望天
2019/06/14
4K0
在pandas中遍历DataFrame行
inp = [{'c1':10, 'c2':100}, {'c1':11,'c2':110}, {'c1':12,'c2':120}]
用户7886150
2020/12/26
3.2K0
在 Linux 中配置SSH登录提示
编辑配置文件 vim /etc/motd 输入内容并保存 Welcome to Pengcheng's Virtual Machine Compute Service ! in case of any issues reach out to admin at Email:pengcheng@pengcheng.team Powered by 鹏程 Thanks!
鹏程
2023/05/02
2.5K0
在 Linux 中配置SSH登录提示
ag-grid 设置单元格以及行的颜色「建议收藏」
在使用ag-grid的时候有通过单元格的值设置不同行颜色,然后百度了网上的方法,汇总了一下,具体效果图如下:
全栈程序员站长
2022/09/14
3.5K0
ag-grid 设置单元格以及行的颜色「建议收藏」
点击加载更多

相似问题

无法使用工具提示组件自定义ag-Grid自定义工具提示

12

Ag-grid自定义工具提示位置更改

185

ag-Grid使用CSS自定义工具提示

23

如何使用material工具提示为ag-grid制作自定义工具提示组件

243

在ag-grid角度中的自定义工具提示部分可见

170
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文