new ComboBox(id, properties) → {Object}
Parameters:
| Name |
Type |
Description |
id |
String
|
The id of the component. |
properties |
Object
|
HTMLElement
|
The properties used to initialize the component or the container element. |
Properties:
- Mixes In:
Returns:
An instance of the component.
-
Type
-
Object
Extends
Classes
- ComboBoxEvents
- Item
Members
allowCustomValue :Boolean
Gets or sets a value indicating whether users can enter values not in the option list.
Type:
Gets or sets a value indicating whether textual input is allowed.
Type:
autoGrow :Boolean
Gets or sets a value indicating if the input box will increase width automatically based on the size of the text.
Type:
Gets or sets the id of the clear button from which the settings are cloned.
Type:
collapseOnItemSelect :Boolean
Gets or sets a value indicating whether the list box is collapsed on an item select.
Type:
columnIdentifyingCssClass :String
Gets or sets the identifying css class of a column.
Type:
Gets or sets the css class of the clear button component.
Type:
Gets or sets the css class of the datapager component.
Type:
Gets or sets the css class of the expand button component.
Type:
cssClassExpandIcon :String
Gets or sets the css class of the expand icon.
Type:
cssClassItem :String
Gets or sets the default css class of an item.
Type:
cssClassItemCheckBox :String
Gets or sets the css class of an item checkbox.
Type:
cssClassItemIcon :String
Gets or sets the css class of an item icon.
Type:
cssClassItemSelectAll :String
Gets or sets the css class of the 'select all' checkbox item.
Type:
cssClassList :String
Gets or sets the css class of the unordered list.
Type:
cssClassListBox :String
Gets or sets the css class of the list box component.
Type:
cssClassNoResult :String
Gets or sets the css class of the noresult container.
Type:
cssClassPreloader :String
Gets or sets the css class of the preloader container.
Type:
Gets or sets the id of the list datapager from which the settings are cloned.
Type:
Gets or sets a value indicating whether the clear button is disabled.
Type:
disableExpandOnClick :Boolean
Gets or sets a value indicating whether the list box can only be expanded by typing, not by clicking the expand button.
Type:
disabled :Boolean
Gets or sets a value indicating whether the combobox is disabled.
Type:
Gets or sets a value indicating whether the datapager is enabled.
Type:
Type:
Gets or sets the id of the expand button from which the settings are cloned.
Type:
Gets or sets or sets the id of the HTML hidden input.
Type:
Gets or sets the list of items.
Type:
itemTemplateId :String|null
Gets or sets the default template id of an item.
Type:
keepSelectionOnReload :Boolean
Gets or sets a value indicating whether the current selection must be kept when reloading data.
Type:
keyboardNavigation :Boolean
Gets or sets a value indicating whether keyboard navigation is allowed.
Type:
listBoxId :String|null
Gets or sets the id of the list box from which the settings are cloned.
Type:
loadOnDemand :Boolean
Gets or sets a value indicating whether the data is loaded when the text input is changed or the list box is expanded.
Type:
loadOnDemandCharStart :Number
Gets or sets the amount of characters required before a load on demand is performed.
Type:
loadOnDemandDelay :Number
Gets or sets the delay in milliseconds on a keydown event before a load on demand is performed.
Type:
loadOnRender :Boolean
Gets or sets a value indicating whether the data is loaded when the component is rendering.
Type:
multiSelect :Boolean
Gets or sets a value indicating whether multiple items can be selected through checkboxes.
Type:
multiSelectTagging :Boolean
Gets or sets a value indicating whether selected items are displayed as tags.
Type:
name :String
Gets or sets the name of the hidden input field which contains the selected value(s).
Type:
placeholder :String
Gets or sets the placeholder which is visible when the input box has no value.
Type:
reloadOnExpand :Boolean
Gets or sets a value indicating whether the data is reloaded when the list box is expanded.
Type:
Gets or sets a value indicating whether the combo box uses a split button.
Type:
Gets or sets the id of the tag button from which the settings are cloned.
Type:
Gets or sets the id of the tooltip to show.
Type:
Gets or sets the tooltip manager used to display tooltips.
Type:
value :String
Gets or sets the initial selected value.
Type:
width :String
Gets or sets the input width in the specified unit.
Type:
(static, readonly) FilterOption :number
Type:
Properties:
| Name |
Type |
Description |
STARTSWITH |
number
|
|
CONTAINS |
number
|
|
EQUALS |
number
|
|
ENDSWITH |
number
|
|
Methods
clear()
Clears the input value and the selected item(s).
clearList()
clearSelection()
Clears the selected item(s).
deselectItem(id)
Deselects the item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
The item identifier. |
deselectItems(ids)
Deselects the items with the specified id.
Parameters:
| Name |
Type |
Description |
ids |
Array
|
The list of item ids. |
destroy()
- See:
-
disable()
disableItem(id)
Disables the item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
The item identifier. |
enable()
enableItem(id)
Enables the item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
The item identifier. |
focus()
Sets the focus on the input element.
Returns:
-
Type
-
HTMLElement
getItemElement(id) → {HTMLElement}
Gets the list-item element for the specified item id.
Parameters:
| Name |
Type |
Description |
id |
String
|
The item identifier. |
Returns:
-
Type
-
HTMLElement
getListBox() → {Box}
Gets the box component which serves as item list container.
Returns:
-
Type
-
Box
getSelectedItem() → {Item}
Returns:
-
Type
-
Item
getSelectedItems() → {Array.<Item>}
Gets the selected items in a multiselect combobox.
Returns:
-
Type
-
Array.<Item>
getValue() → {String}
Returns:
-
Type
-
String
hideListBox()
load(clearopt, pageIndexopt, showListBoxopt)
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
clear |
Boolean
|
<optional>
|
|
Defines if the current selection and input value should be cleared. |
pageIndex |
Number
|
<optional>
|
|
Defines which page index to load. |
showListBox |
Boolean
|
<optional>
|
true
|
Defines if the list box is shown. |
postRender()
Executes the post render procedure.
render()
selectItem(id)
Selects the item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
The item identifier. |
selectItems(ids)
Selects the items with the specified id.
Parameters:
| Name |
Type |
Description |
ids |
Array
|
The list of item ids. |
Sets the footer template.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
HTML string or element node as content. Pass null or empty string to remove the existing template. |
- See:
-
componyx.UI.base.addTemplate
Sets the header template.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
HTML string or element node as content. Pass null or empty string to remove the existing template. |
- See:
-
componyx.UI.base.addTemplate
setItemTagTemplate(content)
Sets the multi-select item tag template. The template supports all data-item interpolations (view Base method comment). Default value: {text}.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
HTML string or element node as content. Pass null or empty string to remove the existing template. |
- See:
-
componyx.UI.base.addTemplate
Sets the multiselect input template. The template supports the below listed interpolations. Default value: {count} items selected
- {count} This value will be replaced with the selected item count.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
HTML string or element node as content. Pass null or empty string to remove the existing template. |
- See:
-
componyx.UI.base.addTemplate
setNoResultTemplate(content)
Sets the no result template.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
Text string. Pass null or empty string to remove the existing template. |
- See:
-
componyx.UI.base.addTemplate
setPlaceholder(text)
Sets the placeholder text.
Parameters:
| Name |
Type |
Description |
text |
String
|
The placeholder text. |
setPreloaderTemplate(content)
Sets the preloader template.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
HTML string or element node as content. Pass null or empty string to remove the existing template. |
- See:
-
componyx.UI.base.addTemplate
setSelectAllTemplate(content)
Sets the select all checkbox template. The template supports the below listed interpolations.
- {checkBox} This value will be replaced with the checkbox element to select all items.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
HTML string or element node as content. Pass null or empty string to remove the existing template. |
- See:
-
componyx.UI.base.addTemplate
setValue(value, focusopt)
Sets the input to the specified value. With multi-select enabled, a comma separated list of item values can be specified.
Parameters:
| Name |
Type |
Attributes |
Description |
value |
String
|
Array.<String>
|
|
The value(s) to set. |
focus |
Boolean
|
<optional>
|
A value indicating if the input should get focus. |
showListBox()
suppressNextChangeEvent(action)
Suppresses any change events fired by the underlying input element during the execution of the provided action. Use this when programmatically setting a component value to prevent the change event from propagating as a user interaction.
The suppression is automatically lifted after the action completes, even if it throws.
Parameters:
| Name |
Type |
Description |
action |
function
|
The action to execute with change events suppressed. |
- Mixes In:
toggleSelectItem(id)
Selects/deselects the item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
The item identifier. |
Type Definitions
ComboBoxEventArgs
Type:
Properties:
| Name |
Type |
Description |
ComboBox |
componyx.UI.ComboBox
|
The ComboBox instance. |
eventArgs |
null
|
Not used, always null. |
ComboBoxItemEventArgs
Type:
Properties:
| Name |
Type |
Description |
ComboBox |
componyx.UI.ComboBox
|
The ComboBox instance. |
eventArgs |
Object
|
The event object containing more detailed information about the event.
Properties
| Name |
Type |
Description |
item |
componyx.UI.ComboBox.Item
|
null
|
The combobox item, null for the input focus/blur events. |
event |
Event
|
The original event object. |
|
ComboBoxQueryEventArgs
Type:
Properties:
| Name |
Type |
Description |
ComboBox |
componyx.UI.ComboBox
|
The ComboBox instance. |
eventArgs |
Object
|
The load query.
Properties
| Name |
Type |
Description |
text |
string
|
The search text. |
pageIndex |
number
|
The page index (1-based). |
|