HoT - Context menu
by Blake Gilchrist
HTML
<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" />
<script src="https://handsontable.com/docs/scripts/fixer.js"></script>
<h3 class="demo-preview">Sheet 1</h3>
<div id="example-basic-multi-sheet-1"></div>
SCSS
h3.demo-preview {
margin-bottom: 0.3rem !important;
padding-top: 0 !important;
margin-top: 0.5rem !important;
}
Babel + JSX
import Handsontable from 'handsontable';
import HyperFormula from 'hyperformula';
import 'handsontable/dist/handsontable.full.min.css';
const data1 = [
['10.26', null, 'Sum', '=SUM(A:A)'],
['20.12', null, 'Average', '=AVERAGE(A:A)'],
['30.01', null, 'Median', '=MEDIAN(A:A)'],
['40.29', null, 'MAX', '=MAX(A:A)'],
['50.18', null, 'MIN', '=MIN(A1:A5)'],
];
// create an external HyperFormula instance
const hyperformulaInstance = HyperFormula.buildEmpty({
// to use an external HyperFormula instance,
// initialize it with the `'internal-use-in-handsontable'` license key
licenseKey: 'internal-use-in-handsontable',
});
const container1 = document.querySelector('#example-basic-multi-sheet-1');
new Handsontable(container1, {
data: data1,
colHeaders: true,
rowHeaders: true,
height: 'auto',
formulas: {
engine: hyperformulaInstance,
sheetName: 'Sheet1',
},
autoWrapRow: true,
autoWrapCol: true,
contextMenu: true,
licenseKey: 'non-commercial-and-evaluation',
});