2017-04-06 95 views
0

我嘗試使用此解決方案,但它不適用於我,它的正確調整列高度,但文本是沒有Wrapeed。 Ag-Grid - Row with multiline textAg-greed cell multiline

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; 
} 

enter image description here

回答

2

如果按照「行高度複雜的例子」關於Docs發現,它說,你需要添加一些CSS讓文字換行。因此,在您的受影響的專欄(zaglavie,如果我按照正確的方式)colDef添加cellStyle: {'white-space': 'normal'}。這是演示的plnkr