【发布时间】:2015-10-11 01:09:17
【问题描述】:
如果任何单元格值为空,我该如何更改背景?该功能只改变TD背景,不改变整行。
function invalidRowRenderer(instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.TextRenderer.apply(this, arguments);
td.style.fontWeight = 'bold';
td.style.background = '#A9A9A9';
}
【问题讨论】:
-
我不熟悉handsontable,但是参数
row是对<tr>的引用吗?在这种情况下,您可能可以设置其样式。如果没有,请尝试使用td.parentNode访问 DOM 中的表格行。
标签: javascript formatting conditional handsontable