Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minExpandLevel does not auto-expand #293

Closed
SpencerTM opened this issue Aug 20, 2014 · 2 comments
Closed

minExpandLevel does not auto-expand #293

SpencerTM opened this issue Aug 20, 2014 · 2 comments
Labels
Milestone

Comments

@SpencerTM
Copy link

I am trying to migrate from dynatree to fancytree.

I have a tree that is loaded with json.

Some settings are

checkbox: true,
selectMode: 3,
icons: false,

When I set minExpandLevel:2 only the root node shows and the ability to expand it is gone.

When I remove the minExpandLevel the tree loads and can be expanded manually.

I set the debugLevel: 2 and $.ui.fancytree.debugInfo = 2; but nothing shows in the console.

Sample html & json files are attached to the question in google groups:
https://groups.google.com/forum/#!topic/fancytree/Ve3SJF86DOY

This still happens with fancytree 2.3.0.

@mar10 mar10 added the bug label Aug 21, 2014
@mar10 mar10 added this to the 2.x Backlog milestone Aug 21, 2014
@mar10
Copy link
Owner

mar10 commented Aug 21, 2014

The desired behavior for minExpandLevel > 1 is (for nodes with level <= minExpandLevel):

  • the node should always be expanded
  • expand/collapse on dblclick is disabled
  • the expander icon should be removed (top level nodes only)

Dynatree behaves like this:http://wwwendt.de/tech/dynatree/doc/sample-minexpand.html

In Fancytree currently only the expander is removed.

(One workaround is to explicilty set 'expanded' on toplevel nodes)

@mar10 mar10 changed the title minExpandLevel minExpandLevel does not auto-expand Aug 21, 2014
@mar10 mar10 closed this as completed in 70efd20 Aug 24, 2014
@flack
Copy link
Contributor

flack commented Sep 21, 2014

@mar10 I just tried your fix on the latest release, but AFAICT it does not cover all cases: I use minExpandLevel: 2, and no other option on a <ul></li> tree, and I still get the same problem as reported in this ticket.

I really don't know anything about the fancytree codebase, but looking at your patch, it seems to me that these three lines here

if( !node.lazy ) {

are wrongly placed. The if(level > 1){ check in the line above means that only nodes from the second level downwards will get extended. If I read the code correctly, that is :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants