日期:2014-05-16  浏览次数:20367 次

【【【【jstree 移除节点的问题】】】】。。。。。。。。。。。。。。。讨论有分啊!!!!!!!速来。。。。
这是我的代码
JScript code

   function customMenu(node) {
            var items = {
                "create": null,
                "rename": null,
                "remove": null,
                "ccp": null,
 "menu_delete": {
                    "label": "删除",
                    "icon": "../../img/delete.png",
                    "action": function(obj) {
                        //alert(obj.attr("rel"));
                        var id = obj.attr("id");
                        if (id == "1") {
                            alert("根节点不能删除")
                            return false;
                        }
                        if (id && confirm("确定删除吗?")) {
                            jQuery.ajax({
                                url: "AjaxService.ashx",
                                cache: false,
                                data: {
                                    CommandName: "DeleteClassByID",
                                    id: id
                                },
                                success: function(data) {
                                    // alert("ok");
                                    $("#class_tree").jstree("remove", null);

                                }
                            });

                        }
                    }
                }
            }
}



------解决方案--------------------
看到说讨论也有分,所以我进来了,坐等LZ结帐,看是不是有分

但又不好意思,所以说两句

$("#class_tree").jstree("remove", null);

虽然没用过jstree,但看这个操作,如果$("#class_tree")指的是整个树的话,

那你remove的动作做用在什么上面, null???