Open brucefeiwang opened 2 years ago
I ran into the same problem. This can be solved in the renderer itself with very little JS knowledge...
MAT = matrix(runif(100, -1, 1), nrow = 10,
dimnames = list(LETTERS[1:10], LETTERS[1:10]))
diag(MAT) = 1
MAT[upper.tri(MAT)] = MAT[lower.tri(MAT)]
rhandsontable(MAT, readOnly = TRUE, width = 750, height = 300) %>%
hot_cols(renderer = "
function (instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.TextRenderer.apply(this, arguments);
if (value > 0.75) {
td.style.background = 'lightgreen';
}
td.innerHTML = `${Number.parseFloat(value).toFixed(1)}`;
}") %>%
hot_cols(fixedColumnsLeft = 3)
last line not getting applied , due to the 'renderer' overwrite ?