我可以通过"插入"键在handontable中添加行吗?

Fai*_*zan 2 jquery handsontable

我想通过"插入"键在handsontable中添加一行.是否可以通过键添加行.

Fai*_*zan 5

这是我的代码,它工作得很好.. :)

$(document).keyup(function(e) {
  if (e.keyCode == 45) { 
    var rowIndex = $('.currentRow').parent().index();

    hot.alter("insert_row", rowIndex);
  }
}); //insert key
Run Code Online (Sandbox Code Playgroud)

" .currentRow "是我当前选择的行类,在当前行tr> td上.这就是我使用$('.currentRow').parent()的
原因,因为我想得到tr索引.