2015-08-30 02:51:52 +03:00
< section >
< h2 id = "allowClear" >
Can I allow users to clear their selections?
< / h2 >
2015-09-13 18:32:41 +03:00
2016-01-15 03:30:11 +03:00
< p >
You can allow people to clear their current selections with the < code > allowClear< / code > option when initializing Select2. Setting this option to < code > true< / code > will enable an "x" icon that will reset the selection to the placeholder.
< / p >
< pre class = "prettyprint" >
$('select').select2({
placeholder: 'This is my placeholder',
allowClear: true
});
< / pre >
< h3 >
Why is a placeholder required?
< / h3 >
{% include options/not-written.html %}
2015-08-30 02:51:52 +03:00
< h3 >
The "x" icon is not clearing the selection
< / h3 >
2015-09-15 02:30:32 +03:00
{% include options/not-written.html %}
2015-09-13 18:32:41 +03:00
2015-08-30 02:51:52 +03:00
< h3 >
Can users remove all of their selections in a multiple select at once?
< / h3 >
2015-09-13 18:32:41 +03:00
2015-09-15 02:30:32 +03:00
{% include options/not-written.html %}
2015-08-30 02:51:52 +03:00
< / section >