Getting info from Handsontabl

Hi, I’m looking to create “views” of spreadsheets. By these I mean I want to save:

  • column widths
  • column orders
  • hidden columns
  • frozen columns
  • filters in effect

I couldn’t find anything in the guides or API as to how to GET the info (and not set). I asked ChatGPT and it gave me:

const settings = {
columnWidths: columnWidths,
columnOrder: hot.getPlugin(‘manualColumnMove’).manualColumnPositions,
hiddenColumns: hot.getPlugin(‘hiddenColumns’).hiddenColumns,
fixedColumnsLeft: hot.getSettings().fixedColumnsLeft,
filters: hot.getPlugin(‘filters’).getConditions(),
};

But I have no clue where it got that as only columnWidths worked.

Is there a way to do this?

Thanks

Hi @john.lescault

Thank you for contacting us. ChatGPT made up most of the methods, that’s why they’re not working.

To get the columns order you can use this method: Core API reference - JavaScript Data Grid | Handsontable For hidden columns, there’s this method: HiddenColumns - JavaScript Data Grid | Handsontable Currently there’s no method to get the fixed columns configuration. Finally, to get the columns filtering state you should use this method to get the conditions: Filters - JavaScript Data Grid | Handsontable

In general I would rather recommend checking our plugins API methods as ChatGPT is very unreliable in this case.

Plugins: API reference: Plugins - JavaScript Data Grid | Handsontable