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

时间:2020-04-28 11:30:54

标签: angular tooltip ag-grid angular9 ag-grid-angular

如何更改自定义工具提示的位置?示例:始终显示在表格的右上角

当前始终显示在光标下方: pic1

我想在表格的右上角显示它: pic2

Ag-grid官方网站上的代码示例:

https://www.ag-grid.com/javascript-grid-tooltip-component/#example-custom-tooltip

感谢您的帮助!

Ag-grid版本:23

1 个答案:

答案 0 :(得分:0)

有一个tooltip-component,其中样式由Ag-Grid自动添加。

尝试添加以下CSS:

.ag-tooltip-custom {
  top: 5px !important;
  right: 14px !important;
  left: auto !important;
}

!important很重要,因为我们需要覆盖赋予style的{​​{1}}。

在图片中,我已添加到tooltip-component,但您应该将其添加到.ag-popup-child。您也可以玩数字游戏。enter image description here

enter image description here