| Issue 164: | Empty tree not handled correctly | |
| 1 person starred this issue and may be notified of changes. | Back to list |
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.
Jan 13, 2011
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
@purusottamkaushik is this fixed with #168 / r453 ?
Jul 17, 2012
considered verified
Jul 17, 2012
(No comment was entered for this change.)
Status:
Verified
|
Labels: Milestone-Release1.0.2