【发布时间】:2019-04-17 19:51:28
【问题描述】:
我的应用程序中有一个功能齐全的 ag-grid-angular,但只要我添加 [popupParent],它就会说它无法绑定,因为它没有 ag-grid-angular 的已知属性。
这行得通:
<ag-grid-angular [id]="name" #grid style="width: 100%;" [gridOptions]="gridOptions" (gridReady)="setDatasource()"(cellContextMenu)="onRightClick()" >
这不是:
<ag-grid-angular [id]="name" #grid style="width: 100%;" [gridOptions]="gridOptions" (gridReady)="setDatasource()" [popupParent]="popupParent"(cellContextMenu)="onRightClick()" >
在组件中:
private popupParent: HTMLElement;
在构造函数中我只是添加
this.popupParent = document.querySelector("body");
预期的结果应该是我将弹出的父级设置为文档的主体元素,这样当我打开菜单时,它就不会被剪切到网格内。
【问题讨论】: