cascaded drop-downs using select2

547 views
Skip to first unread message

ra...@mariposa.us

unread,
May 22, 2014, 11:39:13 PM5/22/14
to sel...@googlegroups.com
Does anyone have some sample code detailing how to implement cascaded drop-downs using select2 and MVC 5?

Thanks,
~randy

Randy Martin

unread,
May 24, 2014, 9:55:54 PM5/24/14
to sel...@googlegroups.com
Anybody?? There's got to be someone who's done this...

Kevin Brown

unread,
May 24, 2014, 9:58:10 PM5/24/14
to sel...@googlegroups.com
Hi Randy,

I've never used Select2 with MVC 5, so I can't help you with anything specific to that.  But if you can expand on what you mean by "cascaded drop-downs", someone may be able to give you some guidance on how to go about doing it.
-- 
Kevin Brown
--
You received this message because you are subscribed to the Google Groups "select2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to select2+u...@googlegroups.com.
To post to this group, send email to sel...@googlegroups.com.
Visit this group at http://groups.google.com/group/select2.
For more options, visit https://groups.google.com/d/optout.

Randy Martin

unread,
May 24, 2014, 10:40:03 PM5/24/14
to sel...@googlegroups.com
Let's say that you have a drop-down that contains locations and another drop-down that contains employees. I want the second drop-down to be populated dynamically with only the employees from the location you select in the first drop-down. I would prefer the update to occur using ajax.

anis.pr...@gmail.com

unread,
Aug 3, 2016, 6:49:56 AM8/3/16
to select2

Here is a tiny JS Snippet for loadeding/refreshing options of a select2 list box using ajax based on selection of another select2 list box. It works with Select2 v4 only.
https://gist.github.com/ajaxray/187e7c9a00666a7ffff52a8a69b8bf31

Reply all
Reply to author
Forward
0 new messages