When using Handsontable how to force a selected cell into edit mode?

前端 未结 3 1323
误落风尘
误落风尘 2021-01-04 11:53

Handsontable provides some nice hooks for when a cell is selected but I can\'t seem to figure out way to get it to allow me to force a cell into edit mode when it has been s

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-04 12:29

    Edit Mode on click:

    afterSelectionEnd: function (r, c, r2, c2) {
      if (r == r2 && c == c2) {
         getActiveEditor().beginEditing();
         getActiveEditor().enableFullEditMode();   
      }
    }
    

    When you add enableFullEditMode(); caret moves in the cell while pressing left or right button instead of jump to another cell.

    Anaother example: only first row:

    afterSelectionEnd: function (r, c, r2, c2) {
      if (r == r2 && c == c2) {
         if (r == 0 && r2 == 0) {
             getActiveEditor().beginEditing();
             getActiveEditor().enableFullEditMode();   
         }
       }
     }
    

提交回复
热议问题