ForgeComponents
en

Components

j-DropdownList

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20

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.

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>