Handsontable example
HTML
<script src="https://cdn.jsdelivr.net/npm/handsontable@12.0/dist/handsontable.full.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable@12.0/dist/handsontable.full.min.css" />
<div id="example1" class="hot "></div>
JavaScript
//pick up the indexes of last two columns
function loadCols(instance){
let cols = [];
let last = instance.countCols()-1;
cols.push(last);
cols.push(last-1);
instance.updateSettings({
manualColumnMove: cols,
fixedColumnsStart: 2
})
}
const container = document.querySelector('#example1');
const hot = new Handsontable(container, {
data: Handsontable.helper.createSpreadsheetData(100, 50),
colWidths: 100,
width: '100%',
height: 320,
contextMenu: true,
rowHeaders: true,
colHeaders: true,
afterLoadData: function(){ loadCols(this) },
manualColumnFreeze: true,
fixedColumnsStart: true,
licenseKey: 'non-commercial-and-evaluation'
});