jqGrid icon indicating copy to clipboard operation
jqGrid copied to clipboard

Virtual scrolling issue with non-uniform height rows

Open davec opened this issue 12 years ago • 2 comments

When using virtual scrolling (i.e., scroll: true), if the table rows are not of uniform height the table height calculation can be off which can lead to a situation where it is not possible to load some rows at the end of the dataset. (Another issue can result in whitespace at the bottom of the table, even after all rows have been added.) This is because the table height calculation assumes that all table rows are the same height as the first visible row.

I encountered this problem with a table that includes HTML markup in one of the columns that expands into multiple lines (e.g., ul). Because of the nature of the data being displayed, it is not possible to know in advance how much space the tallest table row will require so I cannot apply a CSS height to the table's rows in advance.

A relatively simple fix is to force all table rows to be the same height in the updatepager function. See davec/jqGrid@9e3539a33329317d52e6481300ce115238e77ffb for this particular fix. This works in my particular use case now, but I'd be interested in feedback on other approaches to resolve the problem.

davec avatar Sep 08 '11 18:09 davec

The virtual scrolling issue seems to also be affected by subgrid expansion. Expanding multiple subgrids eats into the calculated height eventually making it to where you can no longer scroll to get additional results.

wyscan avatar Dec 10 '11 23:12 wyscan

Hello,

This is true and I will look into this fix. The virtual scrolling is very slippery stuff

tonytomov avatar Sep 17 '13 12:09 tonytomov