Class: AutoRowSize

AutoRowSize

handsontable/src/plugins/autoRowSize/autoRowSize.js, line 64

This plugin allows to set row heights based on their highest cells.

By default, the plugin is declared as undefined, which makes it disabled (same as if it was declared as false).
Enabling this plugin may decrease the overall table performance, as it needs to calculate the heights of all cells to
resize the rows accordingly.
If you experience problems with the performance, try turning this feature off and declaring the row heights manually.

Row height calculations are divided into sync and async part. Each of this parts has their own advantages and
disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous operations don't
block the browser UI.

To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value to a config object:

...
// as a number (300 columns in sync, rest async)
autoRowSize: {syncLimit: 300},
...

...
// as a string (percent)
autoRowSize: {syncLimit: '40%'},
...

You can also use the allowSampleDuplicates option to allow sampling duplicate values when calculating the row height. Note, that this might have
a negative impact on performance.

To configure this plugin see Options#autoRowSize.

Example
...
var hot = new Handsontable(document.getElementById('example'), {
  date: getData(),
  autoRowSize: true
});
// Access to plugin instance:
var plugin = hot.getPlugin('autoRowSize');

plugin.getRowHeight(4);

if (plugin.isEnabled()) {
  // code...
}
...

Members

firstCalculationBoolean

true if only the first calculation was performed.

ghostTableGhostTable

Instance of GhostTable for rows and columns size calculations.

heightsArray

Cached rows heights.

inProgressBoolean

true if the size calculation is in progress.

samplesGeneratorSamplesGenerator

Instance of SamplesGenerator for generating samples necessary for rows height calculations.

Methods

handsontable/src/plugins/autoRowSize/autoRowSize.js, line 203

calculateAllRowsHeight(colRange)

Calculate the height of all the rows.

Parameters:
Name Type Description
colRange Object | Number

Column range object.

handsontable/src/plugins/autoRowSize/autoRowSize.js, line 165

calculateRowsHeight(rowRange, colRange, force)

Calculate a given rows height.

Parameters:
Name Type Default Description
rowRange Number | Object

Row range object.

colRange Number | Object

Column range object.

force Boolean false optional

If true force calculate height even when value was cached earlier.

handsontable/src/plugins/autoRowSize/autoRowSize.js, line 368

clearCache()

Clear cached heights.

handsontable/src/plugins/autoRowSize/autoRowSize.js, line 378

clearCacheByRange(range)

Clear cache by range.

Parameters:
Name Type Description
range Object | Number

Row range object.

handsontable/src/plugins/autoRowSize/autoRowSize.js, line 489

destroy()

Destroy plugin instance.

handsontable/src/plugins/autoRowSize/autoRowSize.js, line 154

disablePlugin()

Disable plugin for this Handsontable instance.

handsontable/src/plugins/autoRowSize/autoRowSize.js, line 132

enablePlugin()

Enable plugin for this Handsontable instance.

handsontable/src/plugins/autoRowSize/autoRowSize.js, line 325

getColumnHeaderHeight(){Number|undefined}

Get the calculated column header height.

Returns: {Number|undefined}
handsontable/src/plugins/autoRowSize/autoRowSize.js, line 334

getFirstVisibleRow(){Number}

Get the first visible row.

Returns: {Number} Returns row index or -1 if table is not rendered.
handsontable/src/plugins/autoRowSize/autoRowSize.js, line 352

getLastVisibleRow(){Number}

Get the last visible row.

Returns: {Number} Returns row index or -1 if table is not rendered.
handsontable/src/plugins/autoRowSize/autoRowSize.js, line 310

getRowHeight(row, defaultHeight){Number}

Get the calculated row height.

Parameters:
Name Type Description
row Number

Visual row index.

defaultHeight Number optional

Default row height. It will be pick up if no calculated height found.

Returns: {Number}
handsontable/src/plugins/autoRowSize/autoRowSize.js, line 284

getSyncCalculationLimit(){Number}

Get value which tells how much rows will be calculated synchronously. Rest rows will be calculated asynchronously.

Returns: {Number}
handsontable/src/plugins/autoRowSize/autoRowSize.js, line 125

isEnabled(){Boolean}

Check if the plugin is enabled in the Handsontable settings.

Returns: {Boolean}
handsontable/src/plugins/autoRowSize/autoRowSize.js, line 390

isNeedRecalculate(){Boolean}

Returns: {Boolean}
handsontable/src/plugins/autoRowSize/autoRowSize.js, line 272

recalculateAllRowsHeight()

Recalculate all rows height (overwrite cache values).