OdinaSpb / jstree

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

Can't reselect after click on node #925

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
after click on node, site refreshed to a new url, this node not reselected.

open and close node works well after refreshed page.

I think because my node is a link, so when you click on a node ,this node do 
selected, but after new link loaded, nothing selected.

Original issue reported on code.google.com by muden...@gmail.com on 16 Mar 2011 at 9:54

GoogleCodeExporter commented 9 years ago
Update:

after install rc3 trunk version, it works, when I click a node, after page 
loaded, It do reselect the node.

But, my site keep load again and again, beacuse every time page loaded ,this 
link selected.

So, plese add a option, make just change node's backgroud_color, not reclick 
the node.

Original comment by muden...@gmail.com on 16 Mar 2011 at 10:10

GoogleCodeExporter commented 9 years ago
Sorry, I fixed. It's my fault.

I have this code:
    $("#tree").bind("select_node.jstree", function (e, data) {
            document.location.href = data.rslt.obj.children("a").attr("href");
    });

Now ,I update my code:
    $("#tree").bind("select_node.jstree", function (e, data) {
        if (document.location.href != data.rslt.obj.children("a").attr("href")){
            document.location.href = data.rslt.obj.children("a").attr("href");
        }
    });

Original comment by muden...@gmail.com on 16 Mar 2011 at 10:24