【发布时间】:2016-03-28 08:43:58
【问题描述】:
我是 handontable.js 的新手,遇到了一个小问题。我创建了一个自定义上下文菜单,效果很好。
现在,当我打开上下文菜单并应用一个项目,然后再次为同一个单元格打开它时,它不会显示为选中状态。有谁知道如何添加这样的选择(以小刻度线/右符号/一些突出显示的形式)?
这是我的代码:
$("#tabledata").handsontable({
data: datas,
startRows: 1,
startCols: 2,
minRows: 1,
minCols: 2,
maxRows: 400,
maxCols: 200,
rowHeaders: true,
colHeaders: false,
minSpareRows: 1,
minSpareCols: 1,
mergeCells: true,
manualColumnResize: true,
manualRowResize: true,
cells: function (row, col, prop) {
var cellProperties = {};
cellProperties.renderer = "defaultRenderer"; //uses lookup map
return cellProperties;
},
contextMenu: {
items: {
"row_above": {},
"row_below": {},
"col_left": {},
"col_right": {},
"hsep2": "---------",
"remove_row": {name:'Remove row(s)'},
"remove_col": {name:'Remove columns(s)'},
"hsep3": "---------",
"alignment" : {},
"mergeCells" : {},
"hsep4": "---------",
"undo": {},
"redo": {},
"hsep5": "---------",
"bold": {"name": "Bold"},
"italic": {"name": "Italic"},
"highlighted": {"name": "Highlight"}
}
},
cell: metadata,
mergeCells: metadata
});
这是它的外观图片:
有人知道吗? 欢迎所有答案。
【问题讨论】:
标签: javascript jquery contextmenu handsontable