Sochettra / dynatree

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

Empty tree not handled correctly #164

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

When the dynatree is using ajax and the json returned is empty (json returned: 
"[]"), it crashed on line #523:

521 if( this === this.tree.tnRoot && this.childList ) {
522   // special case: using ajaxInit
523   this.childList[0].focus();
524 } else {
525   this.focus();
526 } 

because childList is an empty array

If I fix this (add a test on childList.length > 0) then there is another error 
: the text "Loading..." stay forever (it should be cleared)

Btw, you may ask why I've an empty tree :-)
It's because the tree is linked to a dropdown which list all trees saved in the 
database. But when a tree is just created, it's still empty ...

Tx for such a fantastic plugin, I've lost a lot of time trying to work with 
jstree and dynatree is a lot better, it keep it simple and easy.

Original issue reported on code.google.com by Faze1...@gmail.com on 20 Nov 2010 at 8:56

GoogleCodeExporter commented 8 years ago

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

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r423.

Original comment by moo...@wwwendt.de on 21 Nov 2010 at 2:18

GoogleCodeExporter commented 8 years ago
The fix for this issue is not working. We are still getting the error when we 
get an empty tree (child nodes in case of lazy loading). We are using the 
version 1.0.3 and it gives us the javascript error. As per our analysis of the 
code the issue is because it tries to render the child nodes even if they are 
not there. 

Original comment by purusott...@gmail.com on 13 Jan 2011 at 10:16

GoogleCodeExporter commented 8 years ago
@purusottamkaushik
is this fixed with #168 / r453 ?

Original comment by moo...@wwwendt.de on 14 Jan 2011 at 7:40

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