Handsontable example

by galvakojis

HTML

<div id="container"></div>

CSS

</style><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/handsontable.full.min.js"></script><link type="text/css"rel="stylesheet"href="https://cdn.jsdelivr.net/npm/[email protected]/dist/handsontable.full.min.css">

JavaScript

var container = document.getElementById('container');
var hot;

hot = new Handsontable(container, {
  data: Handsontable.helper.createSpreadsheetData(10, 10),
  rowHeaders: true,
  colHeaders: true,
  dropdownMenu: true,
  filters: true,
  columnSorting: true,
  afterFilter() {
    this.executeBatchOperations(() => {
      this.getPlugin('filters').filtersRowsMap.setValueAtIndex(0, false);
      this.getPlugin('filters').filtersRowsMap.setValueAtIndex(1, false);
    });
  },
  afterColumnSort() {
    this.rowIndexMapper.moveIndexes([this.toVisualRow(0)], 0);
  }
});