OdinaSpb / jstree

Automatically exported from code.google.com/p/jstree
0 stars 0 forks source link

Load_node_xml function doesn't work as expected #996

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a jsTree with any data
2. Remove all nodes from the tree
3. Try adding different nodes using load_node_xml method

What is the expected output? What do you see instead?
The expected output is to see new nodes present on the tree, but the old ones 
are visible.

What version of the product are you using? On what browser?
Downloaded jQuery JavaScript Library v1.7.1 and jsTree 1.0-rc3

Please provide any additional information below.
I was trying to reload a different tree to my application, but it loaded back 
the initial tree. Doesn't work neither on small trees, nor on big ones. Here's 
the code for the jsTree definition:

        $(function () {
            $("#scope").jstree({
                "xml_data" : {
                    "data" : "" + XML1
                },
                "theme" : "classic",
                "ui" : {
                    "select_limit" : "2",
                    "initially_select" : ["1"],
                    "selected_parent_open": true,
                    "selected_parent_close" : "select_parent"
                },
                "search": {
                    "case_sensitive" : true,
                    "search_method" : "jstree_contains"
                },
                "plugins" : [ "themes", "xml_data", "ui", "crrm", "sort", "search" ],
                "success": function (x) { return eval('(' + x + ')'); }
            })
            .bind("select_node.jstree", function (event, data) {
                document.getElementById("field").value = "" + data.rslt.obj.attr("id");
            });
        });

Here's a call for loading a new tree:

$("#scope").jstree("load_node_xml", XML2);

Original issue reported on code.google.com by 23darksh...@gmail.com on 27 Mar 2012 at 11:40