Allow auto-resize of column to resize to fit all data in the column
Currently auto-resize only fits on-screen data. Understandably this may not be possible in the general case without requestion all the data, but in cases where all the data is available in memory it would be possible.
An alternative to implementing this in the library would be to simply expose an event fired when a column boundary is double clicked. The event would pass a function for measuring cell width given a passed in string (padding + string width). Client code can then compute the max width and set it in the columns param.
I mean I could add this... How many rows do you have? I can definitely see measuring 10k or so rows to size a column starting to take seconds. It's not a cheap operation.
We probably have rows in the realm of 5-10k. Would it really take that long? If so then not the end of the world not to have this.
Woops wrong bug for that comment.
It would take a considerable amount of time due to the excessive number of measure calls. How homogenous is your data in the rows? Are there likely to be obvious bits that are "oh this is a good candidate to be the widest boy" and "this obviously wont be it"?
For some columns yes. The would probably be some clever ways to estimate the width of the largest column (e.g. caching letter widths and summing them).
we already have a clever way of doing that ;) I am also the author of canvas-hypertxt which was kind of built for this reason.
This is done