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 168: Different behavior for lazy loading a null array for 1.0.3 compared with 0.5.4
3 people starred this issue and may be notified of changes. Back to list
Status:  Verified
Owner:  moo...@wwwendt.de
Closed:  Jan 2011


 
Reported by keitheis, Dec 17, 2010
With the lazy loading, if it returns null array [], there will be an error: 
this.ul is null
jquery.dynatree.js Line 233 

Our quick fix is:
@@ -227,6 +227,9 @@
 		if( !cl ){
 			return;
 		}
+		if (!this.ui) {
+			return;
+		}
 		var childLI = this.ul.firstChild;
 		for(var i=0, l=cl.length-1; i<l; i++) {
 			var childNode1 = cl[i];

Btw, if it returns null, then the result is like what we expected on 0.5.4, the node is expanded, the node icon has a minus prefix, after click the minus, it will try to load children again. On the 1.0.3, if it loads null array, it seems like the node just become a normal node without any expander sign. I'm not sure this is expected behavior.

This is our quick fix:
@@ -391,7 +394,8 @@
 				return undefined;
 			}else if(this.childList.length === 0){
 				// Loaded, but response was empty
-				return false;
+				return undefined;
 			}else if(this.childList.length === 1 && this.childList[0].isStatusNode()){
 				// Currently loading or load error
 				return undefined;


We use Firefox 3.6.13.


Dec 18, 2010
Project Member #1 moo...@wwwendt.de
the first one is a bug.

For the second one: the idea was to the allow server to return both:
- an empty array [], meaning "node has no children".
  The parent will be marked as 'loaded' and is not expandable.
- null or undefined, meaning "don't know".
  The parent will remain 'lazy'
Can you live with that?
Status: Accepted
Owner: moo...@wwwendt.de
Labels: Milestone-Release1.0.4
Dec 20, 2010
#2 keitheis
Yes, we can. thanks! Just confirmed the right behavior.
Jan 13, 2011
Project Member #3 moo...@wwwendt.de
 Issue 170  has been merged into this issue.
Jan 13, 2011
Project Member #4 moo...@wwwendt.de
This issue was closed by revision r453.
Status: Fixed
Jan 23, 2011
Project Member #5 moo...@wwwendt.de
(No comment was entered for this change.)
Labels: Milestone-Release1.1.0
Jul 17, 2012
Project Member #6 moo...@wwwendt.de
considered verified
Jul 17, 2012
Project Member #7 moo...@wwwendt.de
(No comment was entered for this change.)
Status: Verified

Powered by Google Project Hosting