All posts

Handsontable 12.2.0: More flexibility in adding rows and columns

Handsontable 12.2.0 data grid release graphics

We’ve just released version 12.2.0 of Handsontable, our Excel-like data grid. This version expands the ability to add new rows and columns, and brings a few anticipated bug fixes.

New actions of the alter() method

Handsontable’s alter() method has always been a great way to alter your grid’s structure by adding or removing rows and columns.

So far, alter() offered the following actions:

'insert_row' Inserts rows above a specified field.
'insert_col' Inserts columns before a specified column.
'remove_row' Removes specified rows.
'remove_col' Removes specified columns.

Starting with Handsontable 12.2.0, those actions are:

'insert_row_above' Inserts rows above a specified row.
'insert_row_below' Inserts rows below a specified row.
'remove_row' Removes specified rows.
'insert_col_start' Inserts columns before a specified column.
'insert_col_end' Inserts columns after a specified column.
'remove_col' Removes specified columns.
'insert_row' Deprecated: Inserts rows above a specified row.
'insert_col' Deprecated: Inserts columns before a specified column.

As you can see, you’re no longer limited to adding columns before a specified column – you can add columns after it as well. The same goes for rows.

The 'insert_row' and 'insert_col' parameters are marked as deprecated and are still available for backward compatibility. They work the same as 'insert_row_above' and 'insert_col_start', respectively, with one exception – when you call them with no arguments:

hot.alter('insert_row_above') Adds one row to the top of the table.
hot.alter('insert_row') Adds one row to the bottom of the table.
hot.alter('insert_col_start') Adds one column to the beginning of the table.
hot.alter('insert_col) Adds one column to the end of the table.

For a detailed description of the alter() method, see Handsontable’s API reference.

Release notes: what we added

  • Added a new feature that lets you add rows and columns at a specified position. Now, the alter() method takes 4 new parameter values: insert_row_above, insert_row_below, insert_col_start, and insert_col_end. The insert_row and insert_col parameters are marked as deprecated. #9471

Release notes: what we fixed

  • Fixed an issue where the width of the cell editor was calculated incorrectly. #3815
  • Fixed an issue where formulas surrounded by merged cells were converted to values by mistake. #6359
  • Fixed an issue where Handsontable could disappear on Firefox 93 (and later) in a specific use case. #9545
  • Fixed an issue where changing a cell’s type through setCellMeta() didn’t properly set the cell’s editor and renderer. #9734
  • Fixed an issue where the dropdown menu didn’t display when the NestedHeaders plugin was enabled, and all rows were trimmed out. #9753

Release notes: what we removed

  • Removed a type definition for a non-existing method, translateRowsToColumns(). #9919
JW

Jakub Wiśniewski

Handsontable's technical writer

Related posts

See all posts
See all posts

Make every data point count. Turn millions of them into actionable wisdom.

Let’s make it easier.
Smoother. Faster. All Handsontable.