开发者

How can I disable moving in jsTree, but not disabling drag'n'drop plugin?

开发者 https://www.devze.com 2023-01-05 15:21 出处:网络
How to disable moving in jsTree 1.0, but not dis开发者_开发问答abling dnd plugin? Thanks.I found the solution.

How to disable moving in jsTree 1.0, but not dis开发者_开发问答abling dnd plugin?

Thanks.


I found the solution.

   $("#tree").jstree({
//...
      "crrm" : {
        "move" : {
          "check_move" : function (m) {
            return false;
          }
        }
      }
//...
      "plugins" : [ "crrm", "dnd" ]
    });


    "crrm" : {
            "move" : {
                "check_move" : function (m) {
                    if(m.cr.attr("id") == m.r.attr("id")){
                        return true;
                    }else{
                        return false;
                    }
                }
            }
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消