首页 > 解决方案 > Ag Grid - 如何将标准单元格编辑器的宽度和高度设置为单元格的完整宽度和高度

问题描述

我有一个标准单元格编辑器,当我处于编辑模式时,单元格编辑器的宽度和高度不是单元格的完整宽度和高度。

在此处输入图像描述

我应该覆盖样式还是配置中有任何标志来关闭此效果?

标签: ag-grid

解决方案


我有同样的问题。如果您查看 DOM,您会看到ag-grid在所有自定义编辑器周围添加了一个包装器 div,而实际上问题在于该 div。我通过将它添加到我的全局 CSS 来解决它:

.ag-react-container {
    // This class is used on divs automatically inserted by AgGrid around custom cell editors.
    // Without this, I don't know of another way of ensuring that the underlying <input> can take
    // up 100% of the height of the parent cell, if it so chooses to.
    height: 100%;
}

推荐阅读