ListBox
The List Box control displays a list of predefined values, which a user can select using various methods.
Properties
actionFailureText String
Specifies the text to be displayed when a remote request fails.
Default: Error occurred in the request
allowDragAndDrop Boolean
Specifies whether to allow the list of items to be filtered as input is entered into the list box.
Default: false
allowFiltering Boolean
Specifies whether to allow the list of items to be filtered as input is entered into the search box.
Default: false
cssClass String
Specifies CSS classes to customize the appearance of the control.
Default: null
dataStore {:} DataStore String[]
Specifies a list of items that should be bound to the control either via a local object or a remote data source.
Default: []
enabled Boolean
Specifies whether the control is enabled or disabled, disabled will prevent user interaction.
Default: true
enableRtl Boolean
Specifies whether to render the control in right to left direction.
Default: false
enableState Boolean
Specifies whether to persist the state of the control between page loads.
- value
Default: false
fields ItemSettingsModel
Specifies the property mapping for the data source columns to the items in the list.
Default: { }
filterBarPlaceholder String
Specifies a placeholder for the filter search text box.
Default: null
filterType FilterType
Specifies the type of filter to be used when filter the list items.
Default: StartsWith
groupTemplate String Function
Specifies a template to customize the appearance of the grouping headers.
Default: null
height String Number
Specifies the height of the accordion in either pixels, number, or percentage.
Default: ""
ignoreAccent Boolean
Specifies whether to ignore diacritic characters when filtering the list items.
Default: false
ignoreCase Boolean
Specifies whether to ignore the case, make case-sensitive, when filtering the list items.
Default: true
itemTemplate String Function
Specifies a template to customize how the individual list items are displayed in the popup.
Default: null
locale String
Specifies the culture and localization value for this control, overriding the globally defined value.
Default: en-US
noRecordsText String
Specifies the text to be displayed when there are no records to be displayed.
Default: No records found
query Query
Specifies a query that will be executed against the data source before the data source results are bound to the control.
Default: null
scope String
Specifies the scope for dragging and dropping the item. A draggable item will only be accepted by the droppable object if they are in the same scope.
Default: ""
selectionSettings SelectionSettings
Specifies the settings for the selection of list item.
Default: false
toolbarSettings ToolbarSettings
Specifies the settings for the toolbar items.
Default: false
value String[] Number[]
Gets or sets the value of the current selected list item in the control.
Default: null
zIndex Number
Specifies the zIndex of the popup.
Default: 1000
Methods
addEventListener
Attaches an event handler to a specified element. This method allows you to set up a function that will be called whenever the specified event is delivered to the target element.
Parameter | Type | Description |
---|---|---|
eventName | String | A string value that specifies the name of the event. |
handler | Function | Specifies the function to run when the event is triggered. |
Returns: Void
addItem
Adds a new list item to the list box. By default, the newly created item will append to the end of the list unless an index parameter is given.
Parameter | Type | Description |
---|---|---|
data | Object Object[] | Specifies the JSON data to be added to the list. |
index | Number | Specifies the index to position the newly created item within in the popup list. |
Returns: Void
appendTo
Appends the control to the specified HTML element.
Parameter | Type | Description |
---|---|---|
selector | String HTMLElement | The select to a specified HTML element or an HTML element where the control will be appended to. |
Returns: Void
dataBind
Applies all pending property changes to the control.
Returns: Void
destroy
Destroys the Aware instance, detaches all related events, removes attributes, css classes and restores the root element.
Returns: Void
enableItems
Enable or disable the given list items in the list box.
Parameter | Type | Description |
---|---|---|
items | String[] | Specify a list of values to lookup up in the list item collection to enable or disable. |
enable | Boolean | Specify whether the given items should be enabled or disabled. |
isValue | Boolean | Specify whether the given items parameters should be used to look up by the text of the list item or the value. |
Returns: Void
getDataByValue
Gets the data object for the given value.
Parameter | Type | Description |
---|---|---|
value | String Number | Specifies the value of the list item to retrieve. |
Returns: Object
getDataByValues
Gets the data objects for the given list of values.
Parameter | Type | Description |
---|---|---|
value | String[] Number[] | Specifies the list of values of the list item to retrieve data for. |
Returns: Object[]
getItems
Gets all list items currently bound to the control.
Returns: Element[]
getLocalData
Gets the current properties values for the accordion that will be persisted to the state.
Returns: String
getRootElement
Gets the root element of the control.
Returns: HTMLElement
getStateData
Gets the current persisted state data for the control.
Returns: String
hideSpinner
Hides the loading spinner if it is showing.
Returns: Void
moveAllTo
Move all the items in the list box to the specified list box or to the scoped list box.
Parameter | Type | Description |
---|---|---|
targetId | String | Specifies the target list box id where the given items should be moved to. If no value is given, then the list box defined in the scope property will be used. |
index | Number | Specifies the index to move the list items to. |
Returns: Void
moveBottom
Moves the specified items to the bottom of the list.
Parameter | Type | Description |
---|---|---|
values | String[] Number[] | If no value is given, then the selected items in the list box will be moved. |
Returns: Void
moveDown
Moves the specified items down one position within the list.
Parameter | Type | Description |
---|---|---|
values | String[] Number[] | If no value is given, then the selected items in the list box will be moved. |
Returns: Void
moveTo
Move the given items to a specified list box or to the scoped list box.
Parameter | Type | Description |
---|---|---|
values | String[] Number[] | Specifies the values in the list box that should be moved. |
index | Number | Specifies the index to move the list items to. |
targetId | String[] | Specifies the target list box id where the given items should be moved to. If no value is given, then the list box defined in the scope property will be used. |
Returns: Void
moveTop
Moves the specified items to the top of the list.
Parameter | Type | Description |
---|---|---|
values | String[] Number[] | If no value is given, then the selected items in the list box will be moved. |
Returns: Void
moveUp
Moves the specified items up one position within the list.
Parameter | Type | Description |
---|---|---|
values | String[] Number[] | If no value is given, then the selected items in the list box will be moved. |
Returns: Void
refresh
Applies all pending property changes to the accordion and re-renders the control.
Returns: Void
removeEventListener
Removes the attached event handler for the specified event listener.
Parameter | Type | Description |
---|---|---|
eventName | String | A string value that specifies the name of the event to be removed. |
handler | Function | Specifies the function to be removed. |
Returns: Void
removeItems
Removes an item or a list of items from the list box by the list item value of by the list item index.
Parameter | Type | Description |
---|---|---|
items | Object Object[] String String[] Number Number[] | Specifies an item or a list of items to remove from the list box. |
itemIndex | Number | Specifies an index of an item to remove from the list box. |
Returns: Void
selectAll
Selects all the list items or unselect all the list items in the list box based on the given value.
Parameter | Type | Description |
---|---|---|
select | Boolean | Set to true, default value, to select all the items in the list box or false to unselect all the items in the list box. |
Returns: Void
selectItems
Selects or unselects the given list items in the list box based on the given parameters.
Parameter | Type | Description |
---|---|---|
items | String[] | Specifies a list of items to select in the list box. |
select | Boolean | Set to true, default value, to select the items in the list box or false to unselect the items in the list box. |
byValue | Boolean | Specifies whether to find the list item by value or by index. |
Returns: Void
showSpinner
Shows the loading spinner for the control.
Returns: Void
Events
actionBegin EmitType<ActionBeginEventArgs>
Event callback that is raised before retrieving data from the data store.
actionComplete EmitType<ActionCompleteEventArgs>
Event callback that is raised after data has been retrieved from the data store.
actionFailure EmitType<Object>
Event callback that is raised when there is a failure in retrieving data from the data store.
beforeDrop EmitType<DropEventArgs>
Event callback that is raised just before items are dropped into a ListBox control allowing the action to be cancelled.
beforeItemRender EmitType<BeforeItemRenderEventArgs>
Event callback that is raised before each list box item is rendered in the control.
change EmitType<ListBoxChangeEventArgs>
Event callback that is raised when a list box item is selected or unselected.
created EmitType<CreatedEventArgs>
Event callback that is raised when the control has been created.
dataBound EmitType<DataBoundEventArgs>
Event callback that is raised when data has been bound to the control.
destroyed EmitType<Object>
Event callback that is raised when the control has been destroyed.
drag EmitType<DragEventArgs>
Event callback that is raised while a list box item is being dragged.
dragStart EmitType<DragEventArgs>
Event callback that is raised once the dragging of a list box item has begun.
drop EmitType<DropEventArgs>
Event callback that is raised once the item has been dropped into a ListBox control.
filtering EmitType<FilteringEventArgs>
Event callback that is raised while the ListBox is being filtered.