Hello
Here I tried to make last column readonly using cells method, but after remove one column last and second last column will become readonly.
let handSonSelector = document.getElementById("employee-handson");
let header = ["name","state", "class code", "description", "Q1-17", "Q2-17", "Q3-17", "Q4-17", "Total"]
var hot = new Handsontable(handSonSelector, {
startCols: header.length,
startRows: 2,
rowHeaders: true,
manualRowResize: true,
stretchH: 'all',
width: '100%',
height: '100%',
autoRowSize: true,
colHeaders: header,
contextMenu: true,
formulas: true,
//fixedRowsBottom: 1,
//autoColumnSize: {useHeaders: true},
///mergeCells: [ {row: 1, col: 0, rowspan: 1, colspan: 4}],
//ht.updateSettings({mergeCells: [ {row: rows-1, col: 0, rowspan: 1, colspan: 4}]})
//bindRowsWithHeaders: true,
cells: function (row, column,prop) {
var cellMeta = {};
if (column === 1 && (this.instance.countRows()-1)!=row) {
cellMeta.type = 'autocomplete';
cellMeta.source = Object.keys(policyState),
cellMeta.allowInvalid = false
}
if (column === 2 && (this.instance.countRows()-1)!=row) {
cellMeta.type = 'autocomplete';
}
if (column > 4) {
cellMeta.className = 'sum_column';
}
//make column readonly
if ((this.instance.getColHeader().length-1)==column) {
cellMeta.className = 'total_column';
cellMeta.readOnly = true;
}
if ((this.instance.countRows()-1)==row) {
///cellMeta.className = 'total_column';
cellMeta.readOnly = true;
}
return cellMeta;
}
})