Ag grid 为什么无法识别autoHeight属性?
我正在尝试使用设置为true的Ag grid 为什么无法识别autoHeight属性?,ag-grid,Ag Grid,我正在尝试使用设置为true的autoHeight属性创建一些列。然而,我不断收到这些警告: ag-grid: invalid colDef property 'autoHeight' did you mean any of these: suppressAutoSize,headerTooltip,openByDefault,headerComponent,suppressSizeToFit,sort,headerGroupComponent,pivot <...snip...>
autoHeight
属性创建一些列。然而,我不断收到这些警告:
ag-grid: invalid colDef property 'autoHeight' did you mean any of these: suppressAutoSize,headerTooltip,openByDefault,headerComponent,suppressSizeToFit,sort,headerGroupComponent,pivot
<...snip...>
ag-grid: to see all the valid colDef properties please check: https://www.ag-grid.com/javascript-grid-column-properties/
autoHeight
被明确列为有效的列定义属性。不过,在调试器中,我正在查看colDefUtil\u 1.colDefUtil。所有属性
和autoHeight
都不是可用属性之一
我使用的是ag grid enterprise v17.0.0
我的想法是,要么我的版本已经过时,要么文档已经过时。检查v17.0.0
类型定义代码
autoHeight
不是ColDef
的属性
我现在在
PS:评论建议它应该是一个布尔值
这让我想起了一句谚语:)
代码从不说谎,但注释有时会说谎
这是有道理的。这让我很困惑,因为我回顾了以前的发行说明,我一直看到那里提到了autoHeight
属性。Eg-v15.0.0
const columnDefs = [
{
headerName: 'Id',
field: 'id',
filter: 'agTextColumnFilter',
width: 90
}, {
headerName: 'Description',
field: 'sportLeage',
filter: 'agTextColumnFilter',
autoHeight: true,
valueGetter: params =>
params.context.liveEventsController
.createDescription(params.data),
width: 90
};
/** True if this column should stretch rows height to fit contents */
autoHeight?: number;