我使用handontable并尝试使用contextMenu工作。但是,当我点击创建的新行并且上面的行无法正常工作时,我总是遇到错误
这是我的配置:
var $laborTable = $("#exampleGrid");
$laborTable.handsontable({
stretchH: 'all',
startCols: 7,
rowHeaders: true,
minSpareRows: 1,
columnSorting: true,
contextMenu: ['remove_row', 'row_above', 'row_below'],
colWidths: function (index) {
if (index == 7) {
return 5;
}
},
colHeaders: ["Labor Code", "Description", "Person", "Hour", "Rate", "Amount", "Benefits"],
columns: [{
type: 'autocomplete',
source: ["BMW", "Chrysler", "Nissan", "Suzuki", "Toyota", "Volvo"],
strict: false
}, {
type: 'autocomplete',
source: ["yellow", "red", "orange", "green", "blue", "gray", "black", "white"],
strict: true,
allowInvalid: false
}, {
type: 'numeric'
}, {
type: 'numeric'
}, {
type: 'numeric'
}, {
type: 'numeric'
}, {
type: "checkbox"
}],
myPlugin: false
});
这是我的样本fiddle
提前谢谢