1
0
mirror of synced 2024-11-30 00:26:03 +03:00
select2/pages/13.advanced/02.default-adapters/06.dropdown/docs.md

56 lines
1.7 KiB
Markdown
Raw Normal View History

---
title: Dropdown
taxonomy:
category: docs
---
The dropdown adapter defines the main container that the dropdown should be held in. Select2 allows you to change the way that the dropdown works, allowing you to do anything from attach it to a different location in the document or add a search box.
It is common for decorators to attach to the `render` and `position` methods to alter how the dropdown is altered and positioned.
This adapter can be overridden by assigning a custom adapter to the `dropdownAdapter` configuration option.
`select2/dropdown`
## Decorators
### `AttachBody`
2017-09-04 06:09:17 +03:00
This decorator implements the standard [`dropdownParent`](/dropdown#dropdown-placement) method of attaching the dropdown.
2017-09-04 06:09:17 +03:00
**AMD Modules:**
2017-09-04 06:09:17 +03:00
`select2/dropdown/attachBody`
### `AttachContainer`
2017-09-04 06:09:17 +03:00
When this decorator is loaded, Select2 can place the dropdown directly after the selection container, so it will appear in the same location within the DOM as the rest of Select2.
2017-09-04 06:09:17 +03:00
**AMD Modules:**
2017-09-04 06:09:17 +03:00
`select2/dropdown/attachContainer`
2017-09-04 06:09:17 +03:00
>>>> **Check your build.** This module is only included in the [full builds](/getting-started/builds-and-modules) of Select2.
2017-09-04 06:09:17 +03:00
### `DropdownSearch`
2017-09-04 06:09:17 +03:00
This decorator implements the [search box that is displayed at the top of the dropdown](/searching).
2017-09-04 06:09:17 +03:00
**AMD Modules:**
2017-09-04 06:09:17 +03:00
`select2/dropdown/search`
2017-09-04 06:09:17 +03:00
### `MinimumResultsForSearch`
2017-09-04 06:09:17 +03:00
This decorator implements the [`minimumResultsForSearch` configuration option](/searching#limiting-display-of-the-search-box-to-large-result-sets).
2017-09-04 06:09:17 +03:00
**AMD Modules:**
2017-09-04 06:09:17 +03:00
`select2/dropdown/minimumResultsForSearch`
### `CloseOnSelect`
2017-09-04 06:09:17 +03:00
This decorator implements the [`closeOnSelect` configuration option](/dropdown#forcing-the-dropdown-to-remain-open-after-selection).
2017-09-04 06:09:17 +03:00
`select2/dropdown/closeOnSelect`