Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getRowHeight() not working with rowModelType = 'infinite' with latest ag-grid version

I see this Note on ag-grid site:

Changing the row height is only supported in the in memory row model. You cannot use variable row height when using virtual paging, viewport or enterprise row models. This is because these row models need to work out the position of rows that are not loaded and hence need to assume the row height is fixed.

But getRowHeight() was well supported in previous releases(7.x), so was wondering there must be some alternate way to achieve that.

I was using rowModelType='pagination' with previous versions of ag-grid. But Since rowModelType='pagination' is deprecaded, I replaced this with rowModelType='infinite'. But with this, the getRowHeight() is not working as mentioned in there website.

Is there an alternate way to achieve this. My Grid Options:

var gridOptions = {
floatingFilter:true,
debug: true,
enableServerSideSorting: true,
enableServerSideFilter: true,
enableColResize: true,
rowSelection: 'single',
rowDeselection: true,
columnDefs: columnDefs,
rowModelType: 'infinite',
paginationPageSize: 10,
cacheOverflowSize: 2,
maxConcurrentDatasourceRequests: 2,
infiniteInitialRowCount: 1,
maxBlocksInCache: 2,
//rowHeight: 5,
getRowNodeId: function(item) {
    return item.id;
},
getRowHeight: function(params){
  return 300;
}

};

Here is My Plunkr where I tried to use getRowHeight() but it did not work. https://plnkr.co/edit/P6fnVz4ud1A68khuqDtx?p=preview

like image 281
undefined Avatar asked Dec 06 '25 18:12

undefined


1 Answers

getRowHeight() is not supported in infinite row model. getRowHeight only works with the InMemoryRowModel

like image 93
Niall Crosby Avatar answered Dec 08 '25 07:12

Niall Crosby



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!