Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/373.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在jsTree上禁用热键(箭头键)?_Javascript_Jquery_Jstree - Fatal编程技术网

Javascript 如何在jsTree上禁用热键(箭头键)?

Javascript 如何在jsTree上禁用热键(箭头键)?,javascript,jquery,jstree,Javascript,Jquery,Jstree,我只想禁用jsTree视图上的右箭头键。我已尝试使用“热键”禁用它 $('#folder').jstree({ 'hotkeys':{'right':false}, 'core':{ 'themes': { "icons": true }} }) 它不起作用。然后我试着 $('#folder').jstree({ 'hotkeys':{'right':false}, 'core':{ 'themes': { "icons": true }} }).keydown(function(e){

我只想禁用jsTree视图上的右箭头键。我已尝试使用“热键”禁用它

$('#folder').jstree({
'hotkeys':{'right':false},
'core':{ 'themes': { "icons": true }}
})
它不起作用。然后我试着

 $('#folder').jstree({
'hotkeys':{'right':false},
'core':{ 'themes': { "icons": true }}
}).keydown(function(e){
    // right arrow
    if ((e.keyCode || e.which) == 39)
    {
      e.preventDefault()
      e.stopImmediatePropagation() 
      e.stopPropagation()
      e.detail.keyboardEvent.preventDefault();
      return false;

    } 
  });
这也不行。在文件中说

To override any of those - just specify your own function, to disable - just set to false.

但我不能让它工作。你能帮我一下吗?谢谢

我已经用jstreeAPI中的
$.jstree.defaults.core.keyboard解决了这个问题,而不是用“热键”插件。热键插件构建在jsTree中

所以它会在核心

$('#folder').jstree({
'core':{
    'keyboard':{'right':false}, 
    'themes': { "icons": true},
    'data': {
        "dataType": "json"
    }
})