【发布时间】:2018-03-21 13:35:23
【问题描述】:
假设我们需要设置 ag-grid 组件的自动高度,可以通过将 gridOptions 设置为 domLayout="autoHeight" 轻松完成。这适用于单个组件,但对于可以扩展高度的主从(父/子)组件,这不起作用。
同样的问题: https://github.com/ag-grid/ag-grid/issues/205
我需要深入调整它的 css 但仍然无法使其工作,
样式参考:https://www.ag-grid.com/javascript-grid-styling/
Ag 网格 DOM 布局:https://www.ag-grid.com/javascript-grid-width-and-height/#gsc.tab=0
重现示例: https://github.com/ag-grid/ag-grid-vue-example(参见主/详细信息)
调整 gridOptions getRowheight 或其嵌入的 css
相关的css:
.ag-root {
/* set to relative, so absolute popups appear relative to this */
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
/* was getting some 'should be there' scrolls, this sorts it out */
overflow: hidden;
}
.ag-body {
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
https://github.com/ag-grid/ag-grid/blob/master/dist/styles/ag-grid.css
里面还有一个笨蛋:
https://www.ag-grid.com/javascript-grid-master-detail/#gsc.tab=0
作者的另一条线索:https://www.ag-grid.com/javascript-grid-row-height/index.php#gsc.tab=0
固定行的高度 固定行的行高完全按照 有一个区别的正常行 - 不可能动态 设置后更改高度。但是,这很容易解决 再次设置固定的行数据以重置行高。 再次设置数据对于固定行来说不是问题,因为它不是 如果数据被重置,会影响滚动位置、过滤、排序或分组打开/关闭>位置。
【问题讨论】:
标签: javascript css html-table vuejs2 ag-grid