按住拖动可更换上级

基本信息

registerJs(<<") console.log(data.node); }); // 拖拽移动 that.on('move_node.jstree', function(e,data) { moveParentId = data.parent; if (moveParentId === '#'){ moveParentId = 0; } $.ajax({ type: "get", url: '$moveUrl', dataType: "json", data: {id: data.node.id, pid: moveParentId}, success: function(html){ } }); }); // 单击 that.on("activate_node.jstree", function(e, data){ }); // 创建 that.on("create_node.jstree", function(e, data){ }); // 修改 that.on("rename_node.jstree", function(e, data){ }); // 删除 that.on("delete_node.jstree", function(e, data){ }); // 查询节点名称 var to = false; $("#search_ay").keyup(function(){ if(to){ clearTimeout(to); } to = setTimeout(function(){ // 开启插件查询后 使用这个方法可模糊查询节点 that.jstree(true).search($('#search_ay').val()); },250); }); $('.btn-tab').click(function(){ //选项事件 //alert($(this).attr("var")) that.jstree(true).destroy(); //可做联级 that = jstree_fun($(this).attr("var"));//可做联级 //alert($(this).attr("var")) }); $('.refresh').click(function(){ //刷新事件 that.jstree(true).refresh(); that.jstree('uncheck_all'); }); } JS ); ?>