Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/464.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 当使用handsontable.js时,滚动页面上的CSS会发生变化_Javascript_Excel_Web_Render_Handsontable - Fatal编程技术网

Javascript 当使用handsontable.js时,滚动页面上的CSS会发生变化

Javascript 当使用handsontable.js时,滚动页面上的CSS会发生变化,javascript,excel,web,render,handsontable,Javascript,Excel,Web,Render,Handsontable,我在网页上使用一个可触摸的手机 var hot = new Handsontable(container, { data: datatable, colHeaders: true, rowHeaders: true, width: 600, licenseKey: "non-commerc

我在网页上使用一个可触摸的手机

  var hot = new Handsontable(container, {
                    data: datatable,
                    colHeaders: true,
                    rowHeaders: true,
                    width: 600,



                    licenseKey: "non-commercial-and-evaluation",
                });
现在我想通过改变一些单元格的背景色来动态高亮显示它。像这样:

 var dataElements = document.querySelectorAll('.handsontable td');

 if (row_attr == "ALL") {
            for (var k = row * numberOfCols; k < (row + 1) * numberOfCols; k++) {
                dataElements[k].style.backgroundColor = color;
            }
        }
var-dataElements=document.querySelectorAll('.handsontable-td');
如果(行属性=“全部”){
对于(变量k=行*numberOfCols;k<(行+1)*numberOfCols;k++){
数据元素[k].style.backgroundColor=color;
}
}
Thia工作正常,但如果在页面上向下滚动,并返回到该单元格,则该单元格不再着色

有人熟悉handsontable.js吗


我猜表格会动态地呈现表格中显示的部分,但我不确定。

Handsontable会在滚动时重新呈现每个单元格。使用自定义渲染器在滚动时保持样式。请参阅:当您滚动时,Handsontable将重新渲染每个单元格。使用自定义渲染器在滚动时保持样式。见: