| Issue 310: | Loading animation never ends using lazy read on empty folder | |
| 2 people starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
1.Create the following tree:
$("#tree").dynatree({
onLazyRead: function(node){
myajaxcall(params,
function(response){
children = response.result.children;
var i = 0;
while(child=children[i++])
node.addChild(child, null);
}
);
},
autoFocus: false,
persist: false,
children: root // initial content
});
What is the expected output? What do you see instead?
When "children" response is empty and node.addChild(...) is never called, loading animation doesn't stop correctly. If at least one child is added, everything works fine.
I added this work around:
onLazyRead: function(node){
myajaxcall(params,
function(response){
children = response.result.children;
var i = 0;
while(child=children[i++])
node.addChild(child, null);
// Work around to stop loading animation.
if (children.length == 0)
node.setLazyNodeStatus(DTNodeStatus_Ok);
}
);
},
What version of the dynatree and jQuery are you using?
jquery: 1.7.2
jquery-ui: 1.8.7
dynatree: $Version: 1.2.0$ $Revision: 528, 2011-09-17 18:58:59$
On what operating system and browser?
OS: Ubuntu Linux
Browser: Firefox 12.0
What DOCTYPE declaration are you using?
<!DOCTYPE unspecified PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Please provide any additional information below.
May 12, 2012
I did it. I added node.setLazyNodeStatus(DTNodeStatus_Ok); and it is working now. However it should not behave differently if i add or not a child, right?
May 13, 2012
thats true. the next major release will be more robust on this.
Status:
Done
|
Labels: Milestone-Release1.2.1