简体   繁体   English

jstree拖放不起作用

[英]jstree drag and drop not working

The check_callback is set to true and the plugin dnd is included but the drag and drop feature is not enabled. check_callback设置为true,并且包括插件dnd,但未启用拖放功能。 I see a "cannot drag" icon when I try dragging a leaf. 尝试拖动叶子时,我看到一个“无法拖动”图标。 What am I missing? 我想念什么?

HTML: 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: 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" ]
        }
    });

});

将“ plugins”:[“ dnd”,“ wholerow”]放在核心之外

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM