我尝试使用此解决方案,但对我而言不起作用,它的正确大小调整了列的高度,但未包装 文本。Ag-Grid-多行文本行
var gridOptions = {
columnDefs: columnDefs,
rowSelection: 'multiple',
enableColResize: true,
enableSorting: true,
enableFilter: true,
enableRangeSelection: true,
suppressRowClickSelection: true,
animateRows: true,
onModelUpdated: modelUpdated,
debug: true,
autoSizeColumns:true,
getRowHeight: function(params) {
// assuming 50 characters per line, working how how many lines we need
return 18 * (Math.floor(params.data.zaglavie.length / 45) + 1);
}
};
function createRowData() {
return gon.books;
}
Run Code Online (Sandbox Code Playgroud)