Ag-grid 自定义工具提示位置的变化。

问题描述 投票:0回答:1

如何改变自定义工具提示的位置?例如:总是显示在表格的右上角。

目前总是显示在光标下方。pic1

我想把它显示在桌子的右上角。pic2

Ag-grid官网的代码示例。

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

谢谢你的帮助!

Ag-grid版本: 23

angular tooltip ag-grid angular9 ag-grid-angular
1个回答
0
投票

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

尝试添加以下CSS。

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

!important 是很重要的,因为我们需要覆盖 style 给予 tooltip-component.

在图片中,我已经添加到 .ag-popup-child 但你应该把它加到 .ag-tooltip-custom. 你也可以玩玩数字。enter image description here

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.