jannbmsy / dynatree

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

function getNodeByKey didn't work if node loaded from ajax #408

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi.. It's first time for me using dyna tree..
When I load children directly when initializing tree, such as  
children: [ 
                {title: "Item 1"},
                {title: "Folder 2", "key":"item2", isFolder: true,
                    children: [
                        {title: "Sub-item 2.1"},
                        {title: "Sub-item 2.2"}
                    ]
                },
                {title: "Item 3"}
            ],
then if I run this method, it was work :
var tree = $("#tree").dynatree("getTree");
var node = tree.getNodeByKey("item2");
alert(node);

But when I load child nodes on demand (lazy loading) using ajax like this :   
initAjax: { url: "getDataCategory"}. Method above didn't work..
Node was null...

I'm using the latest version of dyna tree..
Any suggestion or it is a bug ?
thx..

Original issue reported on code.google.com by yehezqie...@gmail.com on 18 Mar 2013 at 6:17

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
solved.. There's already function loadKeyPath to get node if loaded from ajax..
thx..

Original comment by yehezqie...@gmail.com on 18 Mar 2013 at 7:36

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 19 Mar 2013 at 5:35