-
Notifications
You must be signed in to change notification settings - Fork 16
/
chosen.jquery.txt
63 lines (56 loc) · 6.07 KB
/
chosen.jquery.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
CHOSEN
ALTERNATIVES ==> #See select2
VERSION ==> #1.1.0
JQ.chosen([OBJ]) #On a SELECT (inside a JQ). Must also include a CSS file.
#Gives a better and customizable UI, and a search/autocomplete function.
#When <select multiple>, shows currently selected option in a nice way.
#CSS classes are :
# - .chosen-container : invisible but with dimension (container).
# Has same id as JQ + "_chosen"
# - .chosen-container-single : when single choice
# - .chosen-container-active : when focus
# - .chosen-with-drop : when drop is opened
# - .chosen-single|multiple : the visible choice
# - .chosen-single|multiple div b : the arrow
# - .chosen-default : placeholder
# - .chosen-drop : the dropdown choices container
# - .chosen-search : the search bar
# - .chosen-results : the choices container
# - .chosen-results > li : the choices
# - .active-result : activated
# - .result-selected : selected
# - .highlighted
# - .no-results : if no choices
#Be careful that own CSS file are read after chosen CSS file for override.
#OBJ members are (at initialization) :
# - width STR (CSS string)
# - allow_single_deselect BOOL (def false) : if first option is a placeholder
# (i.e. is ""), adds a cross button to come back to the placeholder.
# - search_contains (def false) : if true, search can match anywhere, not
# only at beginning of words
# - disable_search BOOL (def false) : disable search function
# - disable_search_threshold UINT : disable it if there are <= UINT items
# - inherit_select_classes BOOL (def false) : adds JQ classes to the chosen
# UI container
# - placeholder_text_single|multiple (def: "Select an Option"/"Select Some
# Options") STR : text displayed when option is "" (should be the first
# one).
# <select data-placeholder=STR> can also be used to override both.
# - no_results_text STR : text displayed when no item is found through the
# search.
# <select data-no_results_text=STR> can also be used to override.
# - max_selected_options UINT : max items when <select multiple>.
# If trying to get beyond max, send "chosen:maxselected" JQEVENT.
# - display_disabled_options BOOL (def true)
# - display_selected_options BOOL (def true) : if false, hide selected
# options on <select multiple> instead of CSS styling
#Other events:
# - "chosen:ready" : when JQ.chosen() is set up
# - "chosen:showing|hiding_dropdown"
# - "change" : same as change DOM event, but event handler is FUNC(JQEVENT,
# OBJ),
# where OBJ.[de]selected is the STR of the option changed.
#If options are changed, JQ.trigger( "chosen:updated" ) must be fired.
JQ.chosen("destroy") #Remove it.