Hello, using v8.3.2, but this error is also present on 9+. I have a simple table set up, and it works well. But when I use the Cells function under updateSettings to add a class to a cell, then force a repaint by scrolling I get the above error. No matter how I try to add the class, the error is thrown. Also, even before I scroll, if I change multiple cells using my function, only the last one persists. Once I scroll, the entire page JS breaks because of the error. Here’s the codepen.
var data = [];
for (i = 0; i < 200; i++) {
data.push({
lastname: "",
firstname: "",
email: "",
courses: "",
duration: "",
analyst: ""
});
}
var container = document.getElementById("example");
var hot = new Handsontable(container, {
data: data,
rowHeaders: true,
//colHeaders: true,
colHeaders: [
"First Name",
"Last Name",
"email",
"courses",
"duration",
"analyst"
],
columns: [
{ data: "firstname" },
{ data: "lastname" },
{ data: "email", className: "email" },
{
data: "courses",
editor: "select",
selectOptions: [
"all: Fundamentals + Q-Bank",
"Fundamentals",
"Q-Bank",
"Fundamentals + Q-Bank CME",
"Fundamentals CME",
"Q-Bank CME"
],
className: "courses"
},
{ data: "duration" },
{ data: "analyst" }
],
colWidths: [120, 120, 250, 225, 100, 100],
filters: true,
dropdownMenu: true,
manualColumnMove: true,
contextMenu: false,
dropdownMenu: false,
licenseKey: "non-commercial-and-evaluation"
});
function colorRow(rowChange,colChange) {
hot.updateSettings({
cells: function (row, col, prop) {
var cell = hot.getCell(row, col);
if (row==rowChange && col==colChange) {
$(cell).addClass("green");
//cell.className = 'green';
//var cellMeta = hot.getCellMeta(row, col);
//hot.setCellMeta(row, col, 'className', 'green');
}
return cell;
}
});
//hot.render();
}
colorRow(3,3);