Sochettra / dynatree

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

dynatree does not work when loading content using jquery .load #151

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When the tree contents are rendered in from main index.htm page everything 
works as expected.

When the tree contents are rendered using jquery .load from the homt.htm page 
dynatree does not work.

Attached are two files:
1.) index.htm - the main html containing the tree contents and javascript to 
load the same tree from home.htm file
2.) home.htm - contains tree content loaded using jquery .load function.

Expecting the trees loaded from index.htm and from home.htm to be rendered 
exactly the same.

Using jquery 1.3.2, jquery ui 1.7.1, dynatree 0.5.4

Windows XP Professional with IE 7, Safari 5.0.1, and Firefox 3.0.19
Windows Server 2003 R2 with IE 7 
Windows Server 2008 Enterprise with IE 8

Original issue reported on code.google.com by tonyru...@bellsouth.net on 7 Sep 2010 at 5:33

Attachments:

GoogleCodeExporter commented 8 years ago
You have to initialize the tree *after* the content was loaded:

{{{
        $('#page_content').load(url + ' #page_content', function(){

            $('#progress').remove();

        $("#tree2").dynatree({

        ...
            }

        });
}}}

Also, there should be no duplicate ids in your file (id='tree' is duplicate)
and the outer tag of the home.html file can be omitted.

Anyway, I would always prefer, to use the built-in initAjax option and provide 
the content in JSON format...

Original comment by moo...@wwwendt.de on 30 Sep 2010 at 6:20

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 21 Nov 2010 at 7:07

GoogleCodeExporter commented 8 years ago
considered verified

Original comment by moo...@wwwendt.de on 17 Jul 2012 at 4:16

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 17 Jul 2012 at 4:19

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 26 Jan 2013 at 4:08