fin-hypergrid / core

A canvas-based super high performant grid renderer API
MIT License
897 stars 144 forks source link

Column value with maximum length only within the Visible Rows #527

Open Dwaynekj opened 7 years ago

Dwaynekj commented 7 years ago

Brought to our attention:

When columnAutosizing=true, the column widths are adjusted(increasing/decreasing) as we scroll. Hypergrid considers the column value with maximum length only within the Visible Rows. That’s why as we scroll, as new rows are added to the Visible Rows, the width of the column is constantly adjusted. Ideally Hypergrid should calculate the column width based on the maximum length from all rows bound to the Grid. This will ensure column width is not adjusted as we scroll.

Dwaynekj commented 7 years ago

From @joneit

We can supply a method to make the suggested calculation but it would mean measuring the text for every cell in every column of every row (visible or not) and is not really practical to do, at least not while scrolling.

And as far as measuring just the visible cells (what we do now), even this text measuring is sucking performance and I recommeded that we cut back on this feature, at least while scrolling. We could eliminate text measure except when needed for rendering (right or center justified needs it; left does not).

It’s a question of performance so we’ll never do this ticket. We could as I said provide a method (or sample code) for an app develop who wants to go and do it anyway.