# j-DropdownList

> j-DropdownList options: required, datasource, limit, disabled, dirplaceholder, dirsearch, check

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: 1db79c7af8640781c39b6ac3e24f56923b5e6d9f2573a25b397d802063937a70
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

__Configuration__:

- `required {Boolean}` enables validation (default: `false`)
- `datasource {String}` a link to the `path {Array}` or inline defined items `key1|value1,key2 with value,key3|value`
- `limit {Number}` a maximum count of selected items (default: `0` disabled)
- `disabled {Boolean}` disables component
- `dirplaceholder {String}` placeholder for `j-Directory`
- `dirsearch {Boolean}` disables searching in `j-Directory` (default: `false`)
- `check {Boolean}` compares selected values with datasource (default: `false`)

Use it with `<ui-component name="dropdownlist">`. When the component is not loaded yet, jComponent downloads it on first use from the address in `DEF.fallback` (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

```html example.html
<ui-component name="LAZY directory" config="placeholder:Search"></ui-component>

<div style="width:400px">
	<ui-component name="dropdownlist" path="form.categoryid" config="datasource:datasource;required:true">Category</ui-component>
	<br />
	<ui-component name="dropdownlist" path="form.inlineid" config="datasource:a|A,b|B,c|C">Inline options</ui-component>
</div>

<script>
	var datasource = [{ name: 'A', id: 1 }, { name: 'B', id: 2 }, { name: 'C', id: 3 }];
	var form = {};
</script>
```
