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

Extend Select2 drop down with a tree view #3269

Closed
ghost opened this issue Apr 20, 2015 · 14 comments
Closed

Extend Select2 drop down with a tree view #3269

ghost opened this issue Apr 20, 2015 · 14 comments
Labels

Comments

@ghost
Copy link

ghost commented Apr 20, 2015

Allowing for a tree structure with multi-select would be tremendously valuable for many use cases. Numerous Select2 users would be grateful as evident in the Google Group.

In many usage scenario's Select2's reliance on search for larger sets of values does not cut it. For one the term to search for might be unclear to the user or worse exist multiple times under different parent items, furthermore it does not work in multi-select scenarios for structured data, i.e., user wants to filter a product list by product (sub)categories.

@mestaritonttu
Copy link

Anyone wanting this right now might look into using this: https://github.com/SE7ENSKY/jquery-select7

@th0r
Copy link

th0r commented May 11, 2016

Guys, do you plan to implement this?
@kevin-brown

@kevin-brown
Copy link
Member

Guys, do you plan to implement this?

Eventually? Yes. It would be as a separate results adapter and definitely wouldn't be in the light build of Select2.

It's not on the roadmap though, but if anyone is interested in creating the adapter we will gladly link to it from the documentation.

@uiliw
Copy link

uiliw commented Jun 9, 2016

Best example to follow is this one made with angularjs, http://codepen.io/chrishanson/pen/nqcGA

@mestaritonttu
Copy link

Guys, Santa just brought us a little something: https://github.com/maliming/select2-treeview

@lonlie
Copy link

lonlie commented Jan 20, 2017

Hi guys, This is my solution, Hope it's useful.
https://github.com/lonlie/select2tree

@dustapplications
Copy link

@lonlie Your plugin looks promising. Kindly improve documentation and translate it in English please so everyone can enjoy it. Thanks

@lonlie
Copy link

lonlie commented Apr 13, 2017

@dustapplications

DariaPlotnikova help me do that. She added instructions in English and Russian for select2tree.

@alexweissman
Copy link
Contributor

Please refrain from submitting "+1" comments, everyone. To show your interest, simply click the 👍 button on the top-level comment.

@clivezhg
Copy link

clivezhg commented Sep 1, 2017

I also faced this issue in my projects.
And I implemented an extension, you can check if my approach is suitable for you.
It's here: https://github.com/clivezhg/select2-to-tree

@charlmert
Copy link

I created a tree view based on google drives tree navigation, when you move a document into a folder. Hope it can be of use to someone else;
http://charl.faceclues.co.za/select2gtree/

@select2 select2 deleted a comment from dbldots Oct 27, 2017
@select2 select2 deleted a comment from rms230 Oct 27, 2017
@select2 select2 deleted a comment from SkylerBloodAT Oct 27, 2017
@select2 select2 deleted a comment from mr-dxdy Oct 27, 2017
@select2 select2 deleted a comment from mnabialek Oct 27, 2017
@select2 select2 deleted a comment from cxxyjsj Oct 27, 2017
@select2 select2 deleted a comment from nikos90 Oct 27, 2017
@select2 select2 deleted a comment from ilizunov Oct 27, 2017
@select2 select2 deleted a comment from jerefrer Oct 27, 2017
@select2 select2 deleted a comment from seamusic Oct 27, 2017
@select2 select2 deleted a comment from wanglian Oct 27, 2017
@select2 select2 deleted a comment from bvizureanu Oct 27, 2017
@select2 select2 deleted a comment from spencerflagg Oct 27, 2017
@select2 select2 deleted a comment from IncM Oct 27, 2017
@select2 select2 deleted a comment from cyberbobjr Oct 27, 2017
@select2 select2 deleted a comment from mmokross Oct 27, 2017
@select2 select2 deleted a comment from deancsmith Oct 27, 2017
@select2 select2 deleted a comment from bamburillo Oct 27, 2017
@select2 select2 deleted a comment from newerton Oct 27, 2017
@select2 select2 deleted a comment from jpastel Oct 27, 2017
@select2 select2 deleted a comment from littlemju Oct 27, 2017
@select2 select2 deleted a comment from uiliw Oct 27, 2017
@select2 select2 deleted a comment from ilakkuvan Oct 27, 2017
@select2 select2 deleted a comment from fryg123 Oct 27, 2017
@select2 select2 deleted a comment from hiryu85 Oct 27, 2017
@select2 select2 deleted a comment from fasatron Oct 27, 2017
@select2 select2 deleted a comment from jilpi Oct 27, 2017
@select2 select2 deleted a comment from Enapiuz Oct 27, 2017
@select2 select2 deleted a comment from garbinmarcelo Oct 27, 2017
@select2 select2 deleted a comment from dairton Oct 27, 2017
@select2 select2 deleted a comment from cornernote Oct 27, 2017
@select2 select2 deleted a comment from metel68 Oct 27, 2017
@select2 select2 deleted a comment from xujingbao Oct 27, 2017
@select2 select2 deleted a comment from benedikt-voigt Oct 27, 2017
@select2 select2 deleted a comment from abaranzano Oct 27, 2017
@select2 select2 deleted a comment from Jokeby Oct 27, 2017
@select2 select2 deleted a comment from rajitha-bandara Oct 27, 2017
@pedrofurtado
Copy link
Contributor

We don't have immediate plans to provide this. We are focused to fix some major UI bugs (that are majority of issues and PR's). But if you open a PR with unit tests, I will be glad to review and approve if everything is ok 👍

@wmkDev
Copy link

wmkDev commented Aug 22, 2019

I was in need of this feature and made my custom implementation of @lonlie version, maybe its useful for someone:

https://jsfiddle.net/kikoDev/6vmzqbn9/

@mariela21180
Copy link

I also faced this issue in my projects.
And I implemented an extension, you can check if my approach is suitable for you.
It's here: https://github.com/clivezhg/select2-to-tree

@clivezhg this is a great solution! thanks!

The only thing that I couldn't sove with your extension is that the parent items remains visible when using the multiple+search options. Image example using your documentation array demo:
image

Could you please tell me if it's possible to force that?

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