我想在打字稿中使用handsontable
$("#dataTable").handsontable({
data: data,
startRows: 5,
startCols: 5,
minSpareRows: 1,
contextMenu: true,
onSelection: function (row, col, row2, col2) {
var meta = container.handsontable('getCellMeta', row2, col2);
if (meta.isWritable == false) {
container.handsontable('updateSettings', { fillHandle: false });
}
else {
container.handsontable('updateSettings', { fillHandle: true });
}
},
cells: function (row, col, prop) {
var cellProperties = {};
if (row === 0 || container.handsontable('getData')[row][col] === 'readOnly') {
cellProperties.readOnly = true; //make cell read-only if it is first row or the text reads 'readOnly'
}
cellProperties.type = {
renderer: negativeValueRenderer
}
return cellProperties;
}
});
但我得到错误:
Error 1 The property 'readOnly' does not exist on value of type ''.
Error 3 The property 'type' does not exist on value of type ''.
我该如何解决?