javascript - 将选择限制为 handsontable 中的整行/列

标签 javascript jquery handsontable

我需要一种方法来仅允许用户使用 handsontable 选择一行或一列(或整行和整列的多项选择)。

最佳答案

经过一些研究和实验,我能够在没有单元格和行句柄的情况下实现单行突出显示。

可上手的选项:

var x = new Handsontable(element, {
    ...
    multiSelect: false,
    disableVisualSelection: ['current', 'area'],
    currentRowClassName: 'currentRow'
}

CSS:

.currentRow, .highlight {
    background-color: lightblue;
}

关于javascript - 将选择限制为 handsontable 中的整行/列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30857341/

相关文章:

javascript - 滚动到页面顶部而不刷新/重新加载该页面

jquery - 悬停只触发内部 div

javascript - 我如何引用一个已经创建的 handson 表来改变它?

javascript - 使用 Jest 测试 Vue 失败,Jest 遇到意外标记,SyntaxError : Unexpected token import

javascript - 如何禁用 jqGrid 行更改为编辑模式时的自动焦点

javascript - 使用 AngularJS 获取集合中选定的元素。声明式方法

javascript - 通过上下文菜单在 rhandsontable 中添加多行

javascript - 代码片段 : Where do I keep them?

javascript - Firefox下jQuery ui dialog css问题

javascript - Handsontable 的 columnSorting 也对固定行进行排序