I do not think it is possible to prevent this behavior. I did not find the slightest clue either in the documentation or in a quick check of the source code.
However, you can deselect the selected cells immediately after selecting them. Binding a function to handle a cell click event would do the trick. You could do this either by registering a callback when creating your hand:
$('#my_handsontable').handsontable({ ... afterOnCellMouseDown: function(event, coords){ // 'coords.row < 0' because we only want to handle clicks on the header row if (coords.row < 0){ $('#my_handsontable').handsontable('deselectCell'); } }, ... });
Or with a hook:
Handsontable.hooks.add('afterOnCellMouseDown', function(event, coords){ if (coords.row < 0){ $('#my_handsontable').handsontable('deselectCell'); } });
Alternatively, you can edit the convenient text and comment on the walkontableConfig code snippet , which makes the entire column selectable when you click on the header cell:
var walkontableConfig = { ... onCellMouseDown: function (event, coords, TD, wt) { ...
Gustavo zago basilio
source share