| Issue 454: | After expanding the lazy node without any children the triangle to expand/collapse does not disappear | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Steps to reproduce: 1. Define onLazyRead callback which doesn't add any child nodes 2. Expand any lazy node. Expected behavior: the icon (triangle) to expand/collapse the node will disappear. Current behavior: the icon is still in its place. jsFiddle: http://jsfiddle.net/Ld6aZ/1/ Dynatree version: 1.2.4
Sep 6, 2013
Project Member
#1
moo...@wwwendt.de
Status:
WontFix
Sep 6, 2013
In 'onLazyRead' I add child nodes programmatically, not using ajax. I get an array with JSON data from some external source and then call 'addChild' method for each item. If the array is empty, 'addChild' will not be called and the icon will not disappear. I updated jsFiddle to demonstrate the simplified version of my code: http://jsfiddle.net/Ld6aZ/4/ What JSON response do you mean?
Sep 7, 2013
In that case you can do this for empty responses:
node.childList = [];
node.render();
With JSON response I meant the Ajax response that is returned by the server, if you use node.appendAjax(). (This is the most common use case for Dynatree lazy loading I think)
N.b.
From a usability perspective it might be nicer to avoid marking these nodes as lazy in the first place. Otherwise every user has to click to find out it's empty.
Sep 25, 2013
Thank you for the workaround, it works.
May 2, 2014
Cleanup Scrumboard
Labels:
Milestone-Release2.0
|