【问题标题】:How to highlight the selected row and header of handsontable?如何突出显示选定的handsontable行和标题?
【发布时间】:2016-08-28 01:50:06
【问题描述】:

作为一个要求,我想在handsontable中突出显示所选单元格的行和列标题,基本上我想在单击一个单元格时更改相应标题的背景颜色。

Handsontable 具有内置属性,可在单击单元格时突出显示整行

var
    data = [
      ['', 'Kia', 'Nissan', 'Toyota', 'Honda'],
      ['2013', 10, 11, 12, 13],
      ['2014', 20, 11, 14, 13],
      ['2015', 30, 15, 12, 13]
    ],
    container = document.getElementById('example1'),
    hot;

  hot = Handsontable(container, {
    data: data,
    minRows: 5,
    minCols: 6,
    currentRowClassName: 'currentRow',
    currentColClassName: 'currentCol',
    rowHeaders: true,
    colHeaders: true
  });

  hot.selectCell(2,2);

但是我只是想通过改变它的背景颜色来突出标题,有没有办法使用自定义渲染器来实现它?

【问题讨论】:

标签: javascript jquery html css handsontable


【解决方案1】:

将示例中的 CSS 代码从 .highlight { … } 更改为 th.highlight { … } 应该可以解决问题。 Handsontable 中的最后表头只是元素。

【讨论】:

    猜你喜欢
    • 2021-01-28
    • 1970-01-01
    • 2017-07-05
    • 1970-01-01
    • 2015-10-31
    • 2013-10-20
    • 2017-03-15
    • 2018-11-20
    • 1970-01-01
    相关资源
    最近更新 更多