ag-grid - 为什么无法识别 autoHeight 属性?
问题描述
我正在尝试使用autoHeight
设置为 true 的属性创建一些列。但是,我不断收到以下警告:
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/
我的列定义如下所示:
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
};
autoHeight
被明确列为有效的列定义属性。虽然,在调试器中,我正在查看colDefUtil_1.ColDefUtil.ALL_PROPERTIES
并且autoHeight
不是可用属性之一。
我正在使用 ag-grid-enterprise v17.0.0。
我的想法是我的版本已过时或文档已过时。
解决方案
在此处检查ag-grid v17.0.0
类型定义代码ColDef
autoHeight
不是 的属性ColDef
。
我目前在v17.1.1
并被autoHeight
宣布为number
.
/** True if this column should stretch rows height to fit contents */
autoHeight?: number;
PS:评论表明它应该是一个boolean
.
现在这让我想起了一句话 :)
代码从不说谎,但评论有时会说谎。
推荐阅读
- python - 如何使右括号“)”与python中的打印行一致?
- cluster-analysis - 关于Tdengine集群主从选择
- python - 用 Python 测试 Collatz 猜想
- android - FlutterFire Firebase 实时数据库在 Android 上显示“客户端离线”错误,但在 iOS 上运行良好
- flutter - 为什么我的字体系列不能在 Flutter 中工作?
- javascript - 无法在多个画布上绘制相同的图像
- redis - 启用集群模式的 Redis 集群中的总计数是否可能少于上传的条目数?
- javascript - 如何将按钮的 id 添加到 td 标签中
- python - IndexError:布尔索引与维度 0 上的索引数组不匹配;维度为 0 但对应的布尔维度为 3
- node.js - 大量连接时nodejs + socketio xhr池错误