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 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
Status:  WontFix
Owner:  ----
Closed:  Sep 2013


 
Reported by alkol...@gmail.com, Sep 6, 2013
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
By convention, if an JSON respionse contains [] (empty list), that means 'no child nodes', so the expander will be removed.
undefined or null means 'not tried to load'

Status: WontFix
Sep 6, 2013
#2 alkol...@gmail.com
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
Project Member #3 moo...@wwwendt.de
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
#4 alkol...@gmail.com
Thank you for the workaround, it works.
May 2, 2014
Project Member #5 moo...@wwwendt.de
Cleanup Scrumboard
Labels: Milestone-Release2.0

Powered by Google Project Hosting