Commit 7316055ac8bc8cca651430c37cbe20dcd79e23cd
1 parent
bf17d976
Exists in
master
and in
4 other branches
multiselect for ajax-users-select2
Showing
2 changed files
with
5 additions
and
2 deletions
Show diff stats
app/assets/javascripts/users_select.js.coffee
... | ... | @@ -11,9 +11,12 @@ $ -> |
11 | 11 | markup += "</div>" |
12 | 12 | markup |
13 | 13 | |
14 | + userFormatSelection = (user) -> | |
15 | + user.name | |
14 | 16 | |
15 | 17 | $('.ajax-users-select').select2 |
16 | 18 | placeholder: "Search for a user" |
19 | + multiple: true | |
17 | 20 | minimumInputLength: 0 |
18 | 21 | ajax: # instead of writing the function to execute the request we use Select2's convenient helper |
19 | 22 | url: "/api/v3/users.json" |
... | ... | @@ -40,7 +43,7 @@ $ -> |
40 | 43 | |
41 | 44 | |
42 | 45 | formatResult: userFormatResult # omitted for brevity, see the source of this page |
43 | - #formatSelection: userFormatSelection # omitted for brevity, see the source of this page | |
46 | + formatSelection: userFormatSelection # omitted for brevity, see the source of this page | |
44 | 47 | dropdownCssClass: "ajax-users-dropdown" # apply css that makes the dropdown taller |
45 | 48 | escapeMarkup: (m) -> # we do not want to escape markup since we are displaying html in results |
46 | 49 | m | ... | ... |
app/controllers/team_members_controller.rb