2015-02-01 2 views

답변

2

참조 예를 들어 나는 문서가 잘못 같은 문제가 있었다. this issue을 확인하십시오. 작업 예를 들어 당신의 바이올린에

다음
beforeKeyDown: function (event) { 
    if (e.keyCode === 46) { 
     Handsontable.Dom.stopImmediatePropagation(event); 
    } 
} 

을 기반으로합니다 변경되었습니다

beforeKeyDown: function (event) { 
    if (e.keyCode === 46) { 
     Handsontable.Dom.enableImmediatePropagation(event); 
     event.stopImmediatePropagation(); 
    } 
} 

주, Handsontable 0.17 구문에서 :

Handsontable 0.16 : 당신은 즉시 전파를 활성화해야 :

$(document).ready(function() 
 
{ 
 
    var data = [ 
 
     ['Nissan', 2009, 'black', 'black'], 
 
     ['Nissan', 2006, 'blue', 'blue'], 
 
     ['Chrysler', 2004, 'yellow', 'black'], 
 
     ['Volvo', 2012, 'yellow', 'gray'] 
 
    ], 
 
    container = document.getElementById("example1"), 
 
    lastChange = null, 
 
    hot; 
 
    
 
    hot = new Handsontable(container, { 
 
    data: data, 
 
    colHeaders: true, 
 
    rowHeaders: true, 
 
    minSpareRows: 1, 
 
    beforeChange: function (changes, source) { 
 
     lastChange = changes; 
 
    } 
 
    }); 
 
    
 
    hot.updateSettings({ 
 
     beforeKeyDown: function (e) { 
 
     if (e.keyCode === 46) { 
 
      Handsontable.Dom.enableImmediatePropagation(e); 
 
      e.stopImmediatePropagation(); 
 
     } 
 
     } 
 
    }); 
 
});
body { background: white; margin: 20px; } 
 
h2 { margin: 20px 0; }
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script> 
 
<script src="http://docs.handsontable.com/0.16.0/bower_components/handsontable/dist/handsontable.full.js"></script> 
 
<link rel="stylesheet" media="screen" href="http://handsontable.com/dist/handsontable.full.css"> 
 
<link rel="stylesheet" media="screen" href="http://handsontable.com/demo/css/samples.css?20140331"> 
 
<link rel="stylesheet" media="screen" href="http://handsontable.com/demo/css/samples.css?20140331"> 
 
<link rel="stylesheet" media="screen" href="http://handsontable.com/demo/css/samples.css?20140331"> 
 

 
<h2>beforeKeyDown callback</h2> 
 
<p>The following demo uses <code>beforeKeyDown</code> callback to modify some key bindings:</p> 
 
<div id="example1" class="handsontable"></div>

관련 문제