Handsontable example

by handsoncode

HTML

<div id="example1"></div>

CSS

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

JavaScript

var example = document.getElementById('example1');
  var hot = new Handsontable(example, {
    data: Handsontable.helper.createSpreadsheetData(5, 5),
    colWidths: 100,
    rowHeaders: true,
    colHeaders: true,
    contextMenu: {
      items: {
        anItem: {
        name: 'menu',
          submenu: {
            items: [{
              key: 'anItem:red',
              name: 'red'
            }, {
              key: 'anItem:blue',
              name: 'blue',
              hidden: function(){
              	return true
              }
            }]
          }
        }
      }
    }
  
  });