如何更改 Ag-Grid header 大小?
How to change Ag-Grid header size?
我想使用相对单位(如"vh")来设置tableheader的大小。我不能使用 css,因为 Ag-Grid 在 .ag-header 和 .[ 中添加了内联样式 "height" =24=]-叠加.
gridOptions.headerHeight = null
没有帮助
您不能通过 Javascript 以编程方式设置它吗?
var x= 10 //for ex. if you want 10vh
gridOptions.headerHeight = document.getElementById('myDiv').clientHeight *(x/100.00);
//Event listener to set header height on resize
object.addEventListener("resize", function(){
var x= 10
myGrid.setHeaderHeight(document.getElementById('myDiv').clientHeight *(x/100.00))
}
);
您似乎没有阅读文档:
"headerHeight The height for the row containing the column label header. If not specified the default is 25px."
/* 分组列 */
groupHeaderHeight:75,
/* 标签列 */
headerHeight: 150,
/* 浮动过滤器 */
floatingFiltersHeight:50,
/* 旋转,需要打开旋转模式。标签列 */
pivotGroupHeaderHeight:50,
/* 旋转,需要打开旋转模式。组列 */
pivotGroupHeaderHeight:100,
我想使用相对单位(如"vh")来设置tableheader的大小。我不能使用 css,因为 Ag-Grid 在 .ag-header 和 .[ 中添加了内联样式 "height" =24=]-叠加.
gridOptions.headerHeight = null
没有帮助
您不能通过 Javascript 以编程方式设置它吗?
var x= 10 //for ex. if you want 10vh
gridOptions.headerHeight = document.getElementById('myDiv').clientHeight *(x/100.00);
//Event listener to set header height on resize
object.addEventListener("resize", function(){
var x= 10
myGrid.setHeaderHeight(document.getElementById('myDiv').clientHeight *(x/100.00))
}
);
您似乎没有阅读文档:
"headerHeight The height for the row containing the column label header. If not specified the default is 25px."
/* 分组列 */ groupHeaderHeight:75,
/* 标签列 */ headerHeight: 150,
/* 浮动过滤器 */ floatingFiltersHeight:50,
/* 旋转,需要打开旋转模式。标签列 */ pivotGroupHeaderHeight:50,
/* 旋转,需要打开旋转模式。组列 */ pivotGroupHeaderHeight:100,