My favorites | Sign in
Project Home Downloads
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 164: Empty tree not handled correctly
1 person starred this issue and may be notified of changes. Back to list
Status:  Verified
Owner:  ----
Closed:  Nov 2010


 
Reported by Faze1...@gmail.com, Nov 20, 2010
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.
Nov 20, 2010
Project Member #1 moo...@wwwendt.de
(No comment was entered for this change.)
Status: Accepted
Labels: Milestone-Release1.0.2
Nov 21, 2010
Project Member #2 moo...@wwwendt.de
This issue was closed by revision r423.
Status: Fixed
Jan 13, 2011
Project Member #3 purusott...@gmail.com
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. 
Jan 13, 2011
Project Member #4 moo...@wwwendt.de
@purusottamkaushik
is this fixed with #168 / r453 ?
Jul 17, 2012
Project Member #5 moo...@wwwendt.de
considered verified
Jul 17, 2012
Project Member #6 moo...@wwwendt.de
(No comment was entered for this change.)
Status: Verified

Powered by Google Project Hosting