Handsontable example

by oo7_sakshi

HTML

<script src="https://docs.handsontable.com/pro/1.14.2/bower_components/handsontable-pro/dist/handsontable.full.min.js"></script>
<link rel="stylesheet" href="https://docs.handsontable.com/pro/1.14.2/bower_components/handsontable-pro/dist/handsontable.full.min.css">
<div id="example1"></div>

JavaScript

document.addEventListener("DOMContentLoaded", function() {

  var
    example = document.getElementById('example1'),
    hot;

  hot = new Handsontable(example, {
    data: Handsontable.helper.createSpreadsheetData(10, 10),
    rowHeaders: true,
    colHeaders: true,
    columnSorting: true
  });

  hot.updateSettings({
    afterSelectionEnd: function(r, c, r2, c2) {
      alert(hot.toPhysicalRow(r));
    }
  })

});