问题
I wanted to make my table height auto using ag-grid. for your information i am using ag-grid infinity mode for rendering table.
I am using ag-grid for vanilla javascript. I already tried the autoHeight that is suggested by documentation but it doesn't work.
column_defs: [
{
autoHeight: true,
cellStyle: {"white-space": "normal"},
field: "paragraph",
headerName: "paragraph",
width: 100
}
]
var gridOptions = {
defaultColDef: {
sortable: true,
filter: 'agTextColumnFilter',
filterParams:{
filterOptions:['contains'],
debounceMs:500,
suppressAndOrCondition: true
},
cellStyle: {'white-space': 'normal', 'word-wrap': 'break-word'},
resizable: true,
editable: true
},
components:{
loadingRenderer:function(params) {
if (params.value !== undefined) {
return params.value;
} else {
return '<img src="../images/loading.gif">';
}
}
},
//debug: true,
columnDefs: columnDefs,
pagination: true,
rowModelType: 'infinite',
onColumnResized: onColumnResized
};
i still got the row not set to auto height but using default height.
来源:https://stackoverflow.com/questions/57705286/how-to-make-ag-grid-autoheight-in-infinity-mode