Ag Grid - How to set the width and height of a standard cell editor to the full width and height of the cell

别说谁变了你拦得住时间么 提交于 2020-01-14 09:48:09

问题


I have a standard cell editor and when I am in edit mode the width and the height of the cell editor is not the full width and height of the cell.

Should I overwrite the styles or is there any flag in the configuration to turn off this effect?


回答1:


I had this same problem. If you look at the DOM, you'll see ag-grid adds a wrapper div around all custom editors, and it's actually that div that is the problem. I solved it by adding this to my global 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%;
}



回答2:


I think a better way to achieve this is to only modify the inline style editor css:

.ag-theme-balham .ag-cell.ag-cell-inline-editing{
 height: 100%;
}


来源:https://stackoverflow.com/questions/52894933/ag-grid-how-to-set-the-width-and-height-of-a-standard-cell-editor-to-the-full

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!