2015-02-23 133 views
0

check_callback設置爲true,並且包含插件dnd,但拖放功能未啓用。當我嘗試拖動樹葉時,看到「無法拖動」圖標。我錯過了什麼?jstree拖放不工作

HTML:

<html> 
    <head> 
     <link rel="stylesheet" href="themes/default/style.min.css"/> 
     <script type="text/javascript" src="jquery-1.8.2.js"></script> 
     <script type="text/javascript" src="jstree.js"></script>  
     <script type="text/javascript" src="index.js"></script> 
    </head> 
    <body> 
     <table> 
      <tr> 
       <th>Tree</th> 
      </tr> 
      <tr> 
       <td><div id="jstree"></div></td> 
      </tr> 
     </table> 
    </body> 
</html> 

JS:

/*jslint browser: true*/ 
/*globals $, alert*/ 
$(function() { 

    'use strict'; 

    var jstreeOriginal = $('#jstree'); 

    jstreeOriginal.bind("loaded.jstree", function() { 
     jstreeOriginal.jstree("open_all"); 
    }); 

    jstreeOriginal.jstree({ 
     "core": { 
      "check_callback": true, 
      "themes": { "stripes": true }, 
      "data": [ 
         { "id" : "ajson1", "parent" : "#", "text" : "Root node" }, 
         { "id" : "ajson2", "parent" : "ajson1", "text" : "Child node" }, 
         { "id" : "ajson3", "parent" : "ajson2", "text" : "Sub Child 1" }, 
         { "id" : "ajson4", "parent" : "ajson2", "text" : "Sub Child 2" }, 
        ], 
      "plugins": [ "dnd", "wholerow" ] 
     } 
    }); 

}); 

回答

1

把 「插件」: 「免打擾」, 「wholerow」]你的核心之外