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

Auto-expand nodes when filtering #394

Closed
simshaun opened this issue Feb 11, 2015 · 2 comments
Closed

Auto-expand nodes when filtering #394

simshaun opened this issue Feb 11, 2015 · 2 comments

Comments

@simshaun
Copy link

Using ext-filter in hide mode:

Given the following tree:

[-] Homepage
   [+] Events
           Event
   [+] News
           Article

When I filter for "Ar", if News is not expanded already, it should be expanded.

I think that should be done by default, but it could also be enabled via an option in the filter extension as well.

@mar10
Copy link
Owner

mar10 commented Apr 13, 2015

Summarizing the discussion from PR #395

If we have a large tree, and slowly type a common character this may be equivalent to expand all, with no way back. So we should make it optional, or even have a separate function like expandMatches(flag) - for example using an option dict.

We should make it easy to support different use cases:

  • while typing in a text box the filter is applied. Either ( Depending on a checkbox?)
    • the matches are made visible (expanded), or
    • folders with matching folders are highlighted (not expanded), or even
    • only counters (badge with count of matching child nodes) are displayed
  • when backspace is clicked or the search text is modified the counters and expansion state should adjust
  • ESC should reset the filter and restore the original expansion state (?)
  • all this should be possible with filterBranches and filterNodes
  • later we might extend this to support lazy trees with Ajax requests

Not everything is required in a first implementation, but it should be possible later without breaking the API.
Adding {expand: true} as second parameter might be a good start

@FroggDev
Copy link

hi,
maybe the match could trigger the expand if more than (x) letters are typed and if no matching node found then collapse expanded nodes ?

@mar10 mar10 closed this as completed in 3b02a50 Apr 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants