Saving data

Saving data

Save data after each change to the data set, using Handsontable's API hooks. Preserve the table's state by saving data to the local storage.

Save changes using a callback

To track changes made in your data grid, use Handsontable's afterChange hook.

The example below handles data by using fetch. Note that this is just a mockup, and nothing is actually saved. You need to implement the server-side part by yourself.

Save data locally

To persist table state (e.g. column order, column widths, row order) across page reloads, use the browser's localStorage (opens new window) API or sessionStorage (opens new window) in your application. Listen to the appropriate hooks (e.g. afterColumnMove, afterColumnResize) and save or restore state as needed.