【Handsontable】特定の列の値に応じて該当行の readOnly を設定

特定の列の値に応じて該当行の readOnly を設定する方法。

こういうのけっこうやりたくないですか?

泥臭い実装になってしまってるんだけど・・。まあ実現できるということで;

 

 

afterInit: function(){
// 全行走査→data_typeが’fixed’ならreadonly=trueを設定
var rowCount = this.countRows();
var colCount = this.countCols();
for (var currentRow = 0; currentRow < rowCount; currentRow++) {
var data_type = this.getDataAtCell(currentRow, 0);
console.log(data_type);
if (data_type === 'fixed') {
for (var currentCol = 0; currentCol < colCount; currentCol++) {
this.setCellMeta(currentRow, currentCol, 'readOnly', true);
}
}
}
},