[GH #7572] Row limit for autoColumnSize

Tags: #<Tag:0x00007f343b543348> #<Tag:0x00007f343b543208>


The autoColumnSize documentation only specifies a way to limit the number of columns considered. However, I do not see any way of limiting the rows.

Take this example where I have 1000 rows and I do activate the plugin. It roughly takes 250ms for computation.

Now take a look here, where I have 10 000 rows. It roughly take 2500ms (logical).

I am working with big grids and I want to also limit the number of rows considered for columns width computation. The methods are built with this possibility. By default, all rows are considered but you can give them a row limit :
calculateAllColumnsWidth(rowRange = { from: 0, to: this.hot.countRows() - 1 }) {

But it does not seem possible to control it since the onAfterLoadData hook does not give any option to these methods. Have I missed something or should I open a feature request regarding this?


Hi @samir.hadzic

We have autoRowSize for rows. It is set to viewport + a couple of more rows (with a standard 23px size) by default.

You may also try those options


I think you misunderstood me. I don’t want to autosize the rows, but the columns. But if I have 10 000 rows, I want the columns to only take the first 100 rows to compute their width (for performance reason).

I tried to use viewportRowRenderingOffsetnumber but it does not seem to affect the autoColumnSize plugin. What I would like would be something like that:

// Compute 40% of the columns width on 40% of the first rows
autoColumnSize: {colSyncLimit: '40%', rowSyncLimit: '40%'},

I can open a feature ticket o GitHub if this is not currently possible.

You are right. With those settings http://jsfiddle.net/handsoncode/ydaLwfgm/ we should be able to have B column as wide as others as the extended value is below the declared viewport.

I will ask my colleague for feedback and get back to you before the weekend.

Hi @samir.hadzic,
At the moment there is no way to customize rows range that autoColumnSize uses for calculations on afterLoadData. Unfortunately, there is also no way to work around the plugin’s behaviour.
I’d like to discuss this feature/improvement next week with the dev-team first and then I’ll open an issue on GitHub with the reference to this thread.
Thank you for your involvement and help in improving Handsontable

1 Like

Hi @piotr.laszczkowski,

Let me know about the outcome. Just to let you known that I’ve just stumbled on this issue : https://github.com/handsontable/handsontable/issues/3339

that you could link to the new issue you will create. I’ll describe my case in the ticket (3339) directly for information.

https://github.com/handsontable/handsontable/issues/3339 touches a little bit different problem.
I added an improvement suggestion on our issue board: https://github.com/handsontable/handsontable/issues/7572. You can follow the work progress there.

Thank you for your involvement in improving Handsontable!

1 Like