ListBox
ListBox allows the user to select one or more items from a list.
Selector
smart-list-box
Properties
Events
Methods
Properties
allowDragboolean
Controls whether users can drag items out of the List box. When enabled, users can drag and move list items, except for those marked as disabled. Disabled items remain fixed and cannot be dragged or moved by the user.
Default value
falseExample
Set the allowDrag property.
<smart-list-box allow-drag></smart-list-box>
Set the allowDrag property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.allowDrag = false;
Get the allowDrag property.
const listbox = document.querySelector('smart-list-box');
let allowDrag = listbox.allowDrag;
allowDropboolean
Controls whether users can drag and drop list items into the target ListBox. When enabled, items can be dropped into the ListBox; when disabled, dropping items is not permitted.
Default value
falseExample
Set the allowDrop property.
<smart-list-box allow-drop></smart-list-box>
Set the allowDrop property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.allowDrop = false;
Get the allowDrop property.
const listbox = document.querySelector('smart-list-box');
let allowDrop = listbox.allowDrop;
alternationCountnumber
Specifies how many times the row colors alternate, controlling the pattern and frequency of color changes applied to rows in a table or list. This helps customize the visual distinction between adjacent rows.
Default value
0Example
Set the alternationCount property.
<smart-list-box alternation-count='true'></smart-list-box>
Set the alternationCount property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.alternationCount = false;
Get the alternationCount property.
const listbox = document.querySelector('smart-list-box');
let alternationCount = listbox.alternationCount;
alternationEndnumber
Specifies the last row index up to which alternating row colors are applied. Rows after this index will no longer display color alternations.
Default value
0Example
Set the alternationEnd property.
<smart-list-box alternation-end='true'></smart-list-box>
Set the alternationEnd property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.alternationEnd = false;
Get the alternationEnd property.
const listbox = document.querySelector('smart-list-box');
let alternationEnd = listbox.alternationEnd;
alternationStartnumber
Specifies the initial row index from which color alternation begins, determining where the alternating row colors pattern is applied in the table.
Default value
0Example
Set the alternationStart property.
<smart-list-box alternation-start='true'></smart-list-box>
Set the alternationStart property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.alternationStart = false;
Get the alternationStart property.
const listbox = document.querySelector('smart-list-box');
let alternationStart = listbox.alternationStart;
animation"none" | "simple" | "advanced"
Specifies the animation mode for the element. You can retrieve the current animation mode or set a new one by assigning a value to this property. When set to 'none', all animations are disabled. To enable different animation effects, assign one of the supported animation mode values other than 'none'.
Allowed Values
- "none" - animation is disabled
- "simple" - ripple animation is disabled
- "advanced" - all animations are enabled
Default value
"advanced"Example
Set the animation property.
<smart-list-box animation='none'></smart-list-box>
Set the animation property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.animation = 'simple';
Get the animation property.
const listbox = document.querySelector('smart-list-box');
let animation = listbox.animation;
autoSortboolean
Controls whether automatic sorting is performed. When autoSort is set to true, the element will automatically re-sort itself whenever its data changes. If sorted is enabled but autoSort is set to false, the element will only be sorted once (typically on initialization) and will not automatically update its order in response to subsequent data changes.
Default value
trueExample
Set the autoSort property.
<smart-list-box auto-sort></smart-list-box>
Set the autoSort property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.autoSort = false;
Get the autoSort property.
const listbox = document.querySelector('smart-list-box');
let autoSort = listbox.autoSort;
dataSourceany
Specifies the source of data to populate the ListBox. The dataSource can be provided in several formats:
- An array of strings or numbers, where each item represents a single ListBox entry.
- An array of objects, where each object defines the properties of a ListBox item, such as label (the displayed text), value (the underlying value), and group (used for grouping items).
- A callback function that returns an array of items in either of the formats described above.
Using these options, you can flexibly supply data from static arrays or dynamically generate the list items as needed.
Example
Set the dataSource property.
<smart-list-box data-source='["item 1", "item 2"]'></smart-list-box>
Set the dataSource property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.dataSource = ["new item 1", "new item 2"];
Get the dataSource property.
const listbox = document.querySelector('smart-list-box');
let dataSource = listbox.dataSource;
disabledboolean
Determines whether the list box is active and can be interacted with by the user. When enabled, users can select items from the list box; when disabled, the list box appears grayed out and does not respond to user input.
Default value
falseExample
Set the disabled property.
<smart-list-box disabled></smart-list-box>
Set the disabled property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.disabled = false;
Get the disabled property.
const listbox = document.querySelector('smart-list-box');
let disabled = listbox.disabled;
displayLoadingIndicatorboolean
Specifies whether a visual indicator (such as a loading spinner or progress bar) will be displayed while filtering data or loading items from a remote source.
Default value
falseExample
Set the displayLoadingIndicator property.
<smart-list-box display-loading-indicator></smart-list-box>
Set the displayLoadingIndicator property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.displayLoadingIndicator = false;
Get the displayLoadingIndicator property.
const listbox = document.querySelector('smart-list-box');
let displayLoadingIndicator = listbox.displayLoadingIndicator;
displayMemberstring
Defines or retrieves the displayMember property, which specifies the name of the object property to be shown in the UI for each item in the data source. The specified name should match a key present in the objects within the collection assigned to the 'dataSource' property. This allows you to control which property value is displayed for each item when rendering data-bound lists or dropdowns.
Default value
""""Example
Set the displayMember property.
<smart-list-box display-member='label'></smart-list-box>
Set the displayMember property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.displayMember = 'name';
Get the displayMember property.
const listbox = document.querySelector('smart-list-box');
let displayMember = listbox.displayMember;
dragFeedbackFormatFunctionfunction | null
A callback function that allows you to customize the HTML markup displayed as visual feedback while an item is being dragged. This function receives a single parameter representing the item currently being dragged, enabling you to tailor the appearance of the drag feedback element based on its properties or content.
Example
Set the dragFeedbackFormatFunction property.
<smart-list-box drag-feedback-format-function='dragFeedbackFormatFunction'></smart-list-box>
Set the dragFeedbackFormatFunction property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.dragFeedbackFormatFunction = function dragFeedbackFormatFunction(draggedItem) { return 'Dragging: ' + draggedItem.label; };
Get the dragFeedbackFormatFunction property.
const listbox = document.querySelector('smart-list-box');
let dragFeedbackFormatFunction = listbox.dragFeedbackFormatFunction;
dragOffsetnumber[]
Specifies the position offset of the drag feedback element relative to the mouse cursor during a drag operation. This property takes an array with two values: the first value sets the horizontal offset (in pixels), and the second value sets the vertical offset (in pixels). These offsets determine how far the feedback element is displayed from the cursor while dragging an item.
Example
Set the dragOffset property.
<smart-list-box drag-offset='[0, 0]'></smart-list-box>
Set the dragOffset property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.dragOffset = [-60, 20];
Get the dragOffset property.
const listbox = document.querySelector('smart-list-box');
let dragOffset = listbox.dragOffset;
dropAction"copy" | "move" | "none"
Specifies the actions or behavior that are triggered when an item is released or dropped during a drag-and-drop operation. This may include updating the interface, modifying data structures, or invoking specific callback functions associated with the drop event.
Allowed Values
- "copy" - Creates a copy of the dragged item and inserts it instead of the original. The original item retains it's place inside the original ListBox.
- "move" - Moves the dragged item to the new host.
- "none" - Nothing changes when the dragged item is dropped.
Default value
"move"Example
Set the dropAction property.
<smart-list-box drop-action='copy'></smart-list-box>
Set the dropAction property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.dropAction = 'move';
Get the dropAction property.
const listbox = document.querySelector('smart-list-box');
let dropAction = listbox.dropAction;
editableboolean
Specifies whether list items are editable. When this option is enabled, users can modify items in the list by either double-clicking on a non-disabled item or by selecting the item and pressing the F2 key. Disabled items remain uneditable regardless of this setting.
Default value
falseExample
Set the editable property.
<smart-list-box editable></smart-list-box>
Set the editable property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.editable = false;
Get the editable property.
const listbox = document.querySelector('smart-list-box');
let editable = listbox.editable;
filterableboolean
Specifies whether users can filter the items in the list. When enabled, a filter input field appears at the top of the list box, allowing users to quickly search and narrow down the displayed items based on their input. If disabled, the entire list is shown without any filtering option.
Default value
falseExample
Set the filterable property.
<smart-list-box filterable></smart-list-box>
Set the filterable property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.filterable = false;
Get the filterable property.
const listbox = document.querySelector('smart-list-box');
let filterable = listbox.filterable;
filterCallbackfunction | null
A callback function that must return a condition (typically a boolean value) used to determine whether each item should be included when filtering the list. This function is called for every item and is intended for use when the filterMode is set to 'custom', allowing you to define your own filtering logic beyond the default behavior.
Example
Set the filterCallback property.
<smart-list-box filter-callback='function(item, searchQuery) { return item.value.toLowerCase() === searchQuery.toLowerCase() }'></smart-list-box>
Set the filterCallback property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.filterCallback = function(item, searchQuery) { return item.value > 5 };
Get the filterCallback property.
const listbox = document.querySelector('smart-list-box');
let filterCallback = listbox.filterCallback;
filterMode"contains" | "containsIgnoreCase" | "doesNotContain" | "doesNotContainIgnoreCase" | "equals" | "equalsIgnoreCase" | "startsWith" | "startsWithIgnoreCase" | "endsWith" | "endsWithIgnoreCase" | "custom"
Specifies which filtering mode is applied to the data set, controlling how items are included or excluded based on defined criteria.
Allowed Values
- "contains" - displays only items with labels that contain the filter string (case sensitive)
- "containsIgnoreCase" - displays only items with labels that contain the filter string (case insensitive)
- "doesNotContain" - displays only items with labels that do not contain the filter string (case sensitive)
- "doesNotContainIgnoreCase" - displays only items with labels that do not contain the filter string (case insensitive)
- "equals" - displays only items with labels that equal the filter string (case sensitive)
- "equalsIgnoreCase" - displays only items with labels that equal the filter string (case insensitive)
- "startsWith" - displays only items with labels that start with the filter string (case sensitive)
- "startsWithIgnoreCase" - displays only items with labels that start with the filter string (case insensitive)
- "endsWith" - displays only items with labels that end with the filter string (case sensitive)
- "endsWithIgnoreCase" - displays only items with labels that end with the filter string (case insensitive)
- "custom" - filtering is applied according to the callback function filterCallback
Default value
"containsIgnoreCase"Example
Set the filterMode property.
<smart-list-box filter-mode='contains'></smart-list-box>
Set the filterMode property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.filterMode = 'equals';
Get the filterMode property.
const listbox = document.querySelector('smart-list-box');
let filterMode = listbox.filterMode;
filterInputPlaceholderstring
Specifies the placeholder text that appears inside the filter input field, guiding users on what to enter or search for.
Default value
""Example
Set the filterInputPlaceholder property.
<smart-list-box filter-input-placeholder='Enter a value:'></smart-list-box>
Set the filterInputPlaceholder property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.filterInputPlaceholder = 'Awaiting entry:';
Get the filterInputPlaceholder property.
const listbox = document.querySelector('smart-list-box');
let filterInputPlaceholder = listbox.filterInputPlaceholder;
groupedboolean
When enabled, this option organizes the items into groups based on the first letter of each item's value. Note: This setting is incompatible with data sources that are already grouped; it can only be used when the dataSource does not contain predefined groupings.
Default value
falseExample
Set the grouped property.
<smart-list-box grouped></smart-list-box>
Set the grouped property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.grouped = false;
Get the grouped property.
const listbox = document.querySelector('smart-list-box');
let grouped = listbox.grouped;
groupMemberstring | null
Specifies the property name within the dataSource object that will be used to group the items in the ListBox. If this property is not set, the component defaults to using the 'group' attribute from each data item for grouping purposes. The groupMember property is particularly useful when loading data from a JSON file as the dataSource and you need to group items based on a specific custom property, rather than the default 'group' property. This allows for flexible and customized grouping behavior based on the structure of your data.
Example
Set the groupMember property.
<smart-list-box group-member='group'></smart-list-box>
Set the groupMember property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.groupMember = section;
Get the groupMember property.
const listbox = document.querySelector('smart-list-box');
let groupMember = listbox.groupMember;
horizontalScrollBarVisibility"auto" | "disabled" | "hidden" | "visible"
Controls whether the horizontal scroll bar is displayed, allowing users to scroll content left and right when it overflows the container.
Allowed Values
- "auto" - The element automatically determines whether or not the horizontal Scroll bar should be visible or not.
- "disabled" - Disables the horizontal Scroll bar.
- "hidden" - Hides the horizontal Scroll bar.
- "visible" - Shows the horizontal Scroll bar even if not necessary.
Default value
"auto"Example
Set the horizontalScrollBarVisibility property.
<smart-list-box horizontal-scroll-bar-visibility='disabled'></smart-list-box>
Set the horizontalScrollBarVisibility property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.horizontalScrollBarVisibility = 'hidden';
Get the horizontalScrollBarVisibility property.
const listbox = document.querySelector('smart-list-box');
let horizontalScrollBarVisibility = listbox.horizontalScrollBarVisibility;
incrementalSearchDelaynumber
The 'IncrementalSearchDelay' property defines the amount of time, in milliseconds, that the system waits after the user stops typing before clearing the previous search query. This delay timer begins as soon as the user ceases input. Only after the specified delay has fully elapsed will the previous search query be reset, allowing a new search query to be initiated. This property helps control the responsiveness of incremental search operations, preventing premature query resets while the user is still entering input.
Default value
700Example
Set the incrementalSearchDelay property.
<smart-list-box incremental-search-delay='group'></smart-list-box>
Set the incrementalSearchDelay property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.incrementalSearchDelay = mygroup;
Get the incrementalSearchDelay property.
const listbox = document.querySelector('smart-list-box');
let incrementalSearchDelay = listbox.incrementalSearchDelay;
incrementalSearchMode"contains" | "containsIgnoreCase" | "doesNotContain" | "doesNotContainIgnoreCase" | "equals" | "equalsIgnoreCase" | "startsWith" | "startsWithIgnoreCase" | "endsWith" | "endsWithIgnoreCase"
Sets or retrieves the current incremental search mode. By default, incremental search is enabled, allowing users to begin searching by typing while the ListBox is focused. This mode enables real-time filtering or selection as the user types, making it easier to quickly find items in the list.
Allowed Values
- "contains" - focuses the item that contains the search query ( case sensitive)
- "containsIgnoreCase" - focuses the item that contains the search query (case insensitive)
- "doesNotContain" - focuses the item that does not contain the search query (case sensitive)
- "doesNotContainIgnoreCase" - focuses the item that does not contain the search query (case insensitive)
- "equals" - focuses the item that is equal the search query (case sensitive)
- "equalsIgnoreCase" - focuses the item that is equal the search query (case insensitive)
- "startsWith" - focuses the item that starts with the search query (case sensitive)
- "startsWithIgnoreCase" - focuses the item that starts with the search query (case insensitive)
- "endsWith" - focuses the item that ends with the search query (case sensitive)
- "endsWithIgnoreCase" - focuses the item that starts with the search query (case insensitive)
Default value
"startsWithIgnoreCase"Example
Set the incrementalSearchMode property.
<smart-list-box incremental-search-mode='contains'></smart-list-box>
Set the incrementalSearchMode property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.incrementalSearchMode = 'endsWith';
Get the incrementalSearchMode property.
const listbox = document.querySelector('smart-list-box');
let incrementalSearchMode = listbox.incrementalSearchMode;
itemHeightnumber
Specifies the height, in pixels, for each item within the list box when virtualization is enabled. This property is required for correct rendering and performance optimizations during virtualization. It ensures each list item is allocated sufficient space and enables efficient scrolling and item measurement.
Example
Set the itemHeight property.
<smart-list-box item-height='50'></smart-list-box>
Set the itemHeight property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.itemHeight = 80;
Get the itemHeight property.
const listbox = document.querySelector('smart-list-box');
let itemHeight = listbox.itemHeight;
itemMeasureMode"auto" | "precise"
Specifies the algorithm used to calculate the width of each item. This setting determines how the item width is measured, such as using fixed values, automatic sizing based on content, or percentage-based calculations.
Allowed Values
- "auto" - measures items based on the number of characters in their label
- "precise" - measures items based on their actual size in the DOM; may hinder performance for large data sources
Default value
"auto"Example
Set the itemMeasureMode property.
<smart-list-box item-measure-mode='precise'></smart-list-box>
Set the itemMeasureMode property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.itemMeasureMode = 'auto';
Get the itemMeasureMode property.
const listbox = document.querySelector('smart-list-box');
let itemMeasureMode = listbox.itemMeasureMode;
items{label: string, value: string}[]
A read-only property that retrieves an array containing all the items currently present in the ListBox. Each element in the array represents a distinct item from the ListBox, preserving their order as displayed.
Default value
nullProperties
labelstring | null
The label of the list item.
Default value
""Get the label property.
const listbox = document.querySelector('smart-list-box');
let label = listbox.items[0].label;
valuestring | null
The value of the list item.
Default value
""Get the value property.
const listbox = document.querySelector('smart-list-box');
let value = listbox.items[0].value;
itemTemplateany
A string specifying either the ID of an HTMLTemplateElement present in the DOM or a direct reference to the template element itself. This property allows you to define a custom template for rendering individual list items, enabling flexible and reusable item layouts within the component.
Example
Set the itemTemplate property.
<smart-list-box item-template=''templateA''></smart-list-box>
Set the itemTemplate property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.itemTemplate = 'templateB';
Get the itemTemplate property.
const listbox = document.querySelector('smart-list-box');
let itemTemplate = listbox.itemTemplate;
loadingIndicatorPlaceholderstring
Specifies the text to be displayed alongside the loading indicator when the loader is visible and positioned at either the top or bottom of the component. This text provides contextual feedback to users during loading operations.
Default value
"Loading..."Example
Set the loadingIndicatorPlaceholder property.
<smart-list-box loading-indicator-placeholder='Incoming data'></smart-list-box>
Set the loadingIndicatorPlaceholder property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.loadingIndicatorPlaceholder = 'LOADING...';
Get the loadingIndicatorPlaceholder property.
const listbox = document.querySelector('smart-list-box');
let loadingIndicatorPlaceholder = listbox.loadingIndicatorPlaceholder;
loadingIndicatorPosition"bottom" | "center" | "top"
Specifies the placement of the loading indicator within the user interface, such as at the top, center, or bottom of the container or screen. This property controls where the loading spinner or progress bar will appear while content is being loaded.
Allowed Values
- "bottom" - Positions the loading indicator at the bottom of the List box.
- "center" - Positions the loading indicator at the center of the List box.
- "top" - Positions the loading indicator at the bottom of the List box.
Default value
"center"Example
Set the loadingIndicatorPosition property.
<smart-list-box loading-indicator-position='bottom'></smart-list-box>
Set the loadingIndicatorPosition property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.loadingIndicatorPosition = 'top';
Get the loadingIndicatorPosition property.
const listbox = document.querySelector('smart-list-box');
let loadingIndicatorPosition = listbox.loadingIndicatorPosition;
unlockKeystring
Gets or sets the unlockKey property, a unique code required to unlock access to the product. This key is used for product activation or to enable restricted features.
Default value
""Example
Set the unlockKey property.
<smart-list-box unlock-key=''></smart-list-box>
Set the unlockKey property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.unlockKey = '1111-2222-3333-4444-5555';
Get the unlockKey property.
const listbox = document.querySelector('smart-list-box');
let unlockKey = listbox.unlockKey;
localestring
Specifies or retrieves the language code to be used for message localization. This property determines which set of messages from the messages object will be displayed, enabling support for multiple languages and dynamic language switching in your application.
Default value
"en"Example
Set the locale property.
<smart-list-box locale='de'></smart-list-box>
Set the locale property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.locale = 'fr';
Get the locale property.
const listbox = document.querySelector('smart-list-box');
let locale = listbox.locale;
localizeFormatFunctionfunction | null
A callback function that allows you to customize the formatting of messages returned by the Localization Module. Use this to modify how localized messages are structured or displayed before they are rendered to the user.
Example
Set the localizeFormatFunction property.
<smart-list-box localize-format-function='function(defaultMessage, message, messageArguments) {return '...'} '></smart-list-box>
Set the localizeFormatFunction property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.localizeFormatFunction = function(defaultMessage, message, messageArguments) {return '...'} ;
Get the localizeFormatFunction property.
const listbox = document.querySelector('smart-list-box');
let localizeFormatFunction = listbox.localizeFormatFunction;
messagesobject
Defines or retrieves an object containing localized strings used throughout the widget’s user interface. This allows you to customize all display text and messages according to different languages or regions. Typically used together with the language property to support internationalization and provide translations for various UI elements.
Default value
"en": {
"propertyUnknownType": "'{{name}}' property is with undefined 'type' member!",
"propertyInvalidValue": "Invalid '{{name}}' property value! Actual value: {{actualValue}}, Expected value: {{value}}!",
"propertyInvalidValueType": "Invalid '{{name}}' property value type! Actual type: {{actualType}}, Expected type: {{type}}!",
"elementNotInDOM": "Element does not exist in DOM! Please, add the element to the DOM, before invoking a method.",
"moduleUndefined": "Module is undefined.",
"missingReference": "{{elementType}}: Missing reference to {{files}}.",
"htmlTemplateNotSuported": "{{elementType}}: Browser doesn't support HTMLTemplate elements.",
"invalidTemplate": "{{elementType}}: '{{property}}' property accepts a string that must match the id of an HTMLTemplate element from the DOM.",
"overridingProperties": "{{elementType}}: Overriding properties {{property1}} and {{property2}} applied. The '{{property1}}' property is used by default.",
"invalidIndex": "{{elementType}}: '{{method}}' method accepts an index of type number or an Array of numbers.",
"indexOutOfBound": "{{elementType}}: Out of bound index/indexes in '{{method}}' method.",
"invalidItem": "{{elementType}}: '{{method}}' method accepts an object or an array of objects as it's second parameter.",
"invalidSettings": "{{elementType}}: '{{method}}' method accepts a string or an object as it's second parameter."
}
Example
Set the messages property.
<smart-list-box messages='{"de":{"propertyUnknownType":"Die Eigenschaft '{{name}}' hat ein nicht definiertes 'type'-Member!","propertyInvalidValue":"Ungultiger Eigenschaftswert '{{name}}'! Aktueller Wert: {{actualValue}}, Erwarteter Wert: {{value}}!","propertyInvalidValueType":"Ungultiger Eigenschaftswert '{{name}}'! Aktueller Wert: {{actualType}}, Erwarteter Wert: {{type}}!","elementNotInDOM":"Element existiert nicht in DOM! Bitte fugen Sie das Element zum DOM hinzu, bevor Sie eine Methode aufrufen.","moduleUndefined":"Modul ist nicht definiert.","missingReference":"{{elementType}}: Fehlender Verweis auf {{files}}.","htmlTemplateNotSuported":"{{elementType}}: Browser unterstutzt keine HTMLTemplate-Elemente.","invalidTemplate":"{{elementType}}: '{{property}}' Die Eigenschaft akzeptiert eine Zeichenfolge, die mit der ID eines HTMLTemplate-Elements aus dem DOM ubereinstimmen muss.","overridingProperties":"{{elementType}}: Uberschreiben der Eigenschaften {{property1}} und {{property2}} angewendet. Die Eigenschaft '{{property1}}' wird standardmassig verwendet.","invalidIndex":"{{elementType}}: '{{method}}' Die Methode akzeptiert einen Index der Typennummer oder ein Zahlenfeld.","indexOutOfBound":"{{elementType}}: ncht gebundener Index / Indizes in Methode '{{method}}'.","invalidItem":"{{elementType}}: '{{method}}' Die Methode akzeptiert ein Objekt oder ein Array von Objekten als zweiten Parameter.","invalidSettings":"{{elementType}}: '{{method}}' Die Methode akzeptiert einen string oder ein Objekt als zweiten Parameter."}}'></smart-list-box>
Set the messages property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.messages = {"en":{"propertyUnknownType":"'{{name}}' property is with undefined 'type' member!","propertyInvalidValue":"Invalid '{{name}}' property value! Actual value: {{actualValue}}, Expected value: {{value}}!","propertyInvalidValueType":"Invalid '{{name}}' property value type! Actual type: {{actualType}}, Expected type: {{type}}!","elementNotInDOM":"Element does not exist in DOM! Please, add the element to the DOM, before invoking a method.","moduleUndefined":"Module is undefined.","missingReference":"{{elementType}}: Missing reference to {{files}}.","htmlTemplateNotSuported":"{{elementType}}: Browser doesn't support HTMLTemplate elements.","invalidTemplate":"{{elementType}}: '{{property}}' property accepts a string that must match the id of an HTMLTemplate element from the DOM.","overridingProperties":"{{elementType}}: Overriding properties {{property1}} and {{property2}} applied. The '{{property1}}' property is used by default.","invalidIndex":"{{elementType}}: '{{method}}' method accepts an index of type number or an Array of numbers.","indexOutOfBound":"{{elementType}}: Out of bound index/indexes in '{{method}}' method.","invalidItem":"{{elementType}}: '{{method}}' method accepts an object or an array of objects as it's second parameter.","invalidSettings":"{{elementType}}: '{{method}}' method accepts a string or an object as it's second parameter."}};
Get the messages property.
const listbox = document.querySelector('smart-list-box');
let messages = listbox.messages;
namestring
Sets or retrieves the value of the element's name attribute. The name attribute identifies the element when submitting an HTML form, allowing its value to be included in the form data sent to the server. This is essential for processing form fields on the server-side.
Default value
""""Example
Set the name property.
<smart-list-box name='Name'></smart-list-box>
Set the name property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.name = 'New Name';
Get the name property.
const listbox = document.querySelector('smart-list-box');
let name = listbox.name;
placeholderstring
Specifies the placeholder text that will be displayed in the List box when there are no available items to show. This text provides guidance or information to the user when the List box is empty.
Default value
"No Items"Example
Set the placeholder property.
<smart-list-box placeholder='Placeholder'></smart-list-box>
Set the placeholder property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.placeholder = 'New Placeholder';
Get the placeholder property.
const listbox = document.querySelector('smart-list-box');
let placeholder = listbox.placeholder;
readonlyboolean
Sets or retrieves the readonly property of the element. When the readonly property is set to true, the element becomes non-editable—users can view its content but cannot modify it. This property is commonly used with input and textarea elements to prevent user interaction while still displaying the field’s value.
Default value
falseExample
Set the readonly property.
<smart-list-box readonly></smart-list-box>
Set the readonly property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.readonly = true;
Get the readonly property.
const listbox = document.querySelector('smart-list-box');
let readonly = listbox.readonly;
rightToLeftboolean
Specifies or retrieves a value that determines whether the element’s text direction is set to right-to-left (RTL) alignment, enabling proper display and support for languages and locales that use right-to-left scripts, such as Arabic or Hebrew.
Default value
falseExample
Set the rightToLeft property.
<smart-list-box right-to-left></smart-list-box>
Set the rightToLeft property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.rightToLeft = true;
Get the rightToLeft property.
const listbox = document.querySelector('smart-list-box');
let rightToLeft = listbox.rightToLeft;
selectedIndexesnumber[]
Gets or sets the selected indexes. The selected indexes property is an array containing the numerical indexes of the items that are currently selected. Assigning an array of indexes will update the selection to match those items; retrieving this property returns the array of currently selected item indexes.
Example
Set the selectedIndexes property.
<smart-list-box selected-indexes='[1,2,3]'></smart-list-box>
Set the selectedIndexes property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.selectedIndexes = [4,5,6];
Get the selectedIndexes property.
const listbox = document.querySelector('smart-list-box');
let selectedIndexes = listbox.selectedIndexes;
selectedValuesstring[]
Sets or retrieves the selected indexes. The selected values correspond to the values of the items that are currently selected. When setting, provide an array of indexes or values to specify which items should be marked as selected; when getting, this returns the values associated with the selected items.
Example
Set the selectedValues property.
<smart-list-box selected-values='["item 1"]'></smart-list-box>
Set the selectedValues property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.selectedValues = ["item 2"];
Get the selectedValues property.
const listbox = document.querySelector('smart-list-box');
let selectedValues = listbox.selectedValues;
selectionMode"none" | "oneOrManyExtended" | "zeroOrMany" | "oneOrMany" | "zeroAndOne" | "zeroOrOne" | "one" | "checkBox" | "radioButton"
Specifies the maximum number of items that a user can select, based on the current selection mode (e.g., single, multiple, or none). This setting controls and restricts selection behavior within the interface.
Allowed Values
- "none" - Item selection is not allowed.
- "oneOrManyExtended" - Only one item can be selected but when pressing the Shift or Control keys of the keyboard more then one item can be selected. Shift key allows to select a range of items while Control allows to select/unselect speciic items. There is always at least one selected item
- "zeroOrMany" - Zero or many items can be selected.
- "oneOrMany" - One or more items must be selected. There is always at least one selected item
- "zeroAndOne" - Only one item can optionally be selected.
- "zeroOrOne" - Zero or one item can be selected.
- "one" - Only one item can be selected. There is always at least one selected item
- "checkBox" - A Check box appears next to every List item inside the List box. One, many or zero items can be selected.
- "radioButton" - A radio button appears next to every List item inside the List box. Only one item can be selected or one item per group if grouped is enabled.
Default value
"oneOrManyExtended"Example
Set the selectionMode property.
<smart-list-box selection-mode='zeroOrMany'></smart-list-box>
Set the selectionMode property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.selectionMode = 'zeroOrOne';
Get the selectionMode property.
const listbox = document.querySelector('smart-list-box');
let selectionMode = listbox.selectionMode;
selectionChangeAction"press" | "release"
Specifies the user interaction event that triggers the selection of a listbox item: either when the item is initially pressed (‘press’) or when the user releases the press (‘release’). Choosing ‘press’ selects the item on mouse down or touch start, while ‘release’ selects it on mouse up or touch end. This setting controls how and when the user’s selection action is registered.
Default value
"release"Example
Set the selectionChangeAction property.
<smart-list-box selection-change-action='press'></smart-list-box>
Set the selectionChangeAction property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.selectionChangeAction = 'release';
Get the selectionChangeAction property.
const listbox = document.querySelector('smart-list-box');
let selectionChangeAction = listbox.selectionChangeAction;
sortedboolean
Specifies whether the items should be automatically arranged in alphabetical order. If set to true, the items will be displayed from A to Z (or according to the selected locale’s alphabetical rules); if false, items will retain their original order.
Default value
falseExample
Set the sorted property.
<smart-list-box sorted></smart-list-box>
Set the sorted property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.sorted = false;
Get the sorted property.
const listbox = document.querySelector('smart-list-box');
let sorted = listbox.sorted;
sortDirectionstring
Specifies the sorting order for the data. Accepts either 'asc' for ascending order (from lowest to highest) or 'desc' for descending order (from highest to lowest).
Default value
"asc"Example
Set the sortDirection property.
<smart-list-box sort-direction='desc'></smart-list-box>
Set the sortDirection property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.sortDirection = 'asc';
Get the sortDirection property.
const listbox = document.querySelector('smart-list-box');
let sortDirection = listbox.sortDirection;
themestring
Specifies the visual theme applied to the element. Themes control the overall appearance, including colors, fonts, spacing, and other stylistic properties that define the element's look and feel. Choosing a theme ensures consistency and enhances the user interface design across the application.
Default value
""Example
Set the theme property.
<smart-list-box theme='blue'></smart-list-box>
Set the theme property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.theme = 'red';
Get the theme property.
const listbox = document.querySelector('smart-list-box');
let theme = listbox.theme;
topVisibleIndexnumber
Scrolls the list box so that the item at the specified index appears as the first (topmost) visible item, ensuring it is fully in view at the top of the list.
Default value
-1Example
Set the topVisibleIndex property.
<smart-list-box top-visible-index='20'></smart-list-box>
Set the topVisibleIndex property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.topVisibleIndex = 2;
Get the topVisibleIndex property.
const listbox = document.querySelector('smart-list-box');
let topVisibleIndex = listbox.topVisibleIndex;
unfocusableboolean
When set to true, this property prevents the element from receiving keyboard focus, meaning users will not be able to select the element using the keyboard (e.g., via the Tab key) or by programmatic focus methods.
Default value
falseExample
Set the unfocusable property.
<smart-list-box unfocusable></smart-list-box>
Set the unfocusable property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.unfocusable = false;
Get the unfocusable property.
const listbox = document.querySelector('smart-list-box');
let unfocusable = listbox.unfocusable;
valueany
Gets or sets the current selection value(s). This property returns an array of objects, where each object represents a selected option with the following structure: { label: string, value: any }. The 'label' is the display text shown to users, and 'value' holds the corresponding data for that option. Return type: { label: string, value: any }[].
Example
Set the value property.
<smart-list-box value='1'></smart-list-box>
Set the value property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.value = 2;
Get the value property.
const listbox = document.querySelector('smart-list-box');
let value = listbox.value;
valueMemberstring
Determines which property of each item object should be used as the item's value. The specified property is stored as the value in the item object. Similar to groupMember, the valueMember property is particularly useful when binding data from a JSON file as a dataSource for the ListBox, allowing you to designate a specific field to serve as the value for each item. This is helpful when your data objects contain multiple properties, and you want to control exactly which one will represent the underlying value of each ListBox entry.
Default value
""""Example
Set the valueMember property.
<smart-list-box value-member='value'></smart-list-box>
Set the valueMember property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.valueMember = 'newValue';
Get the valueMember property.
const listbox = document.querySelector('smart-list-box');
let valueMember = listbox.valueMember;
verticalScrollBarVisibility"auto" | "disabled" | "hidden" | "visible"
Controls whether the vertical scroll bar is displayed, allowing users to scroll through content vertically when it overflows the container. This setting can be used to show, hide, or automatically display the scroll bar based on the content size.
Allowed Values
- "auto" - The element automatically determines whether or not the horizontal Scroll bar should be visible or not.
- "disabled" - Disables the horizontal Scroll bar.
- "hidden" - Hides the horizontal Scroll bar.
- "visible" - Shows the horizontal Scroll bar even if not necessary.
Default value
"auto"Example
Set the verticalScrollBarVisibility property.
<smart-list-box vertical-scroll-bar-visibility='hidden'></smart-list-box>
Set the verticalScrollBarVisibility property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.verticalScrollBarVisibility = 'visible';
Get the verticalScrollBarVisibility property.
const listbox = document.querySelector('smart-list-box');
let verticalScrollBarVisibility = listbox.verticalScrollBarVisibility;
virtualizedboolean
Specifies whether virtualization is enabled for the ListBox. When virtualization is enabled, the ListBox renders only the visible items in the UI, instead of generating UI elements for every item in the collection. This significantly improves performance and reduces memory usage, especially when working with large data sets (e.g., displaying one million items). Virtualization ensures smooth scrolling and responsiveness, even with a vast number of items in the ListBox.
Default value
falseExample
Set the virtualized property.
<smart-list-box virtualized></smart-list-box>
Set the virtualized property by using the HTML Element's instance.
const listbox = document.querySelector('smart-list-box');
listbox.virtualized = false;
Get the virtualized property.
const listbox = document.querySelector('smart-list-box');
let virtualized = listbox.virtualized;
Events
bindingCompleteCustomEvent
This event is triggered after the listbox has successfully finished binding its data source. At this point, all data items have been loaded and rendered in the listbox, making it ready for user interaction or further programmatic manipulation. Use this event to perform actions that depend on the completion of data binding, such as customizing item appearance, enabling controls, or initiating additional data processing.
- Bubbles Yes
- Cancelable No
- Interface CustomEvent
- Event handler property onBindingComplete
Arguments
evCustomEvent
Methods
isDefaultPrevented
Returns true if the event was prevented by any of its subscribers.
Returns
boolean true if the default action was prevented. Otherwise, returns false.
preventDefault
The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.
stopPropagation
The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
Example
Set up the event handler of bindingComplete event.
const listbox = document.querySelector('smart-list-box'); listbox.addEventListener('bindingComplete', function (event) { // event handling code goes here. })
changeCustomEvent
This event is triggered whenever the user changes the current selection, such as when they select a different item from a list, dropdown, or any selectable element. It allows developers to respond dynamically to user input by detecting and handling selection changes in real time.
- Bubbles Yes
- Cancelable No
- Interface CustomEvent
- Event handler property onChange
Arguments
evCustomEvent
ev.detailObject
ev.detail.addedItems - An array of List items that have been selected.
ev.detail.disabled - A flag indicating whether or not the item that caused the change event is disabled.
ev.detail.index - The index of the List item that triggered the event.
ev.detail.label - The label of the List item that triggered the event.
ev.detail.removedItems - An array of List items that have been unselected before the event was fired.
ev.detail.selected - The selected state of the List item that triggered the event. If an item was selected the value will be true and vice versa.
ev.detail.value - The value of the List item that triggered the event.
Methods
isDefaultPrevented
Returns true if the event was prevented by any of its subscribers.
Returns
boolean true if the default action was prevented. Otherwise, returns false.
preventDefault
The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.
stopPropagation
The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
Example
Set up the event handler of change event.
const listbox = document.querySelector('smart-list-box'); listbox.addEventListener('change', function (event) { const detail = event.detail, addedItems = detail.addedItems, disabled = detail.disabled, index = detail.index, label = detail.label, removedItems = detail.removedItems, selected = detail.selected, value = detail.value; // event handling code goes here. })
dragEndCustomEvent
This event is fired when a user drops a draggable item onto a valid drop target. Within the event handler, you can call event.preventDefault() to cancel the default drop behavior, which allows you to define custom handling logic for the dropped item. This gives you full control over what should happen when an item is released on the target element.
- Bubbles Yes
- Cancelable Yes
- Interface CustomEvent
- Event handler property onDragEnd
Arguments
evCustomEvent
ev.detailObject
ev.detail.container - The List box that an item was dragged to.
ev.detail.data - An object that contains data about the dragging operation like start position, start time, etc.
ev.detail.item - The List item that was dragged.
ev.detail.originalEvent - That original event that was fired.
ev.detail.previousContainer - The List box that an item was dragged from.
ev.detail.target - The event target.
Methods
isDefaultPrevented
Returns true if the event was prevented by any of its subscribers.
Returns
boolean true if the default action was prevented. Otherwise, returns false.
preventDefault
The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.
stopPropagation
The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
Example
Set up the event handler of dragEnd event.
const listbox = document.querySelector('smart-list-box'); listbox.addEventListener('dragEnd', function (event) { const detail = event.detail, container = detail.container, data = detail.data, item = detail.item, originalEvent = detail.originalEvent, previousContainer = detail.previousContainer, target = detail.target; // event handling code goes here. })
draggingCustomEvent
This event is triggered whenever a user starts dragging a list item, providing an opportunity to handle custom logic—such as updating the UI or managing the item's state—during the drag operation.
- Bubbles Yes
- Cancelable Yes
- Interface CustomEvent
- Event handler property onDragging
Arguments
evCustomEvent
ev.detailObject
ev.detail.data - An object that contains data about the dragging operation like start position, start time, etc.
ev.detail.item - The List item that is being dragged. This is the item that has been clicked when initiating the drag operation
ev.detail.originalEvent - The original event that initiates the dragging operation.
Methods
isDefaultPrevented
Returns true if the event was prevented by any of its subscribers.
Returns
boolean true if the default action was prevented. Otherwise, returns false.
preventDefault
The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.
stopPropagation
The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
Example
Set up the event handler of dragging event.
const listbox = document.querySelector('smart-list-box'); listbox.addEventListener('dragging', function (event) { const detail = event.detail, data = detail.data, item = detail.item, originalEvent = detail.originalEvent; // event handling code goes here. })
dragStartCustomEvent
This event is triggered whenever a user initiates and performs a drag action on an item. Within the event handler, you can call event.preventDefault() to cancel or prevent the default drag behavior. This allows you to override the standard dragging operation and implement custom drag-and-drop functionality as needed.
- Bubbles Yes
- Cancelable Yes
- Interface CustomEvent
- Event handler property onDragStart
Arguments
evCustomEvent
ev.detailObject
ev.detail.container - The List box that an item was dragged to.
ev.detail.data - An object that contains data about the dragging oepration like start position, start time, etc.
ev.detail.item - The List item that was dragged.
ev.detail.originalEvent - That original event that was fired.
ev.detail.previousContainer - The List box that an item was dragged from.
ev.detail.target - The event target.
Methods
isDefaultPrevented
Returns true if the event was prevented by any of its subscribers.
Returns
boolean true if the default action was prevented. Otherwise, returns false.
preventDefault
The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.
stopPropagation
The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
Example
Set up the event handler of dragStart event.
const listbox = document.querySelector('smart-list-box'); listbox.addEventListener('dragStart', function (event) { const detail = event.detail, container = detail.container, data = detail.data, item = detail.item, originalEvent = detail.originalEvent, previousContainer = detail.previousContainer, target = detail.target; // event handling code goes here. })
itemClickCustomEvent
This event is triggered whenever a user clicks on an item within the component. It provides detailed information about the clicked item, such as its identifier and relevant data, enabling you to implement custom logic in response to user interactions.
- Bubbles Yes
- Cancelable No
- Interface CustomEvent
- Event handler property onItemClick
Arguments
evCustomEvent
ev.detailObject
ev.detail.disabled - Indicates whether the List item that was clicked is disabled or not.
ev.detail.index - Indicates the index of the List item that was clicked.
ev.detail.label - The label of the List item that was clicked.
ev.detail.selected - Indicates whether the List item that was clicked is selected or not.
ev.detail.value - The value of the List item that was clicked.
Methods
isDefaultPrevented
Returns true if the event was prevented by any of its subscribers.
Returns
boolean true if the default action was prevented. Otherwise, returns false.
preventDefault
The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.
stopPropagation
The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
Example
Set up the event handler of itemClick event.
const listbox = document.querySelector('smart-list-box'); listbox.addEventListener('itemClick', function (event) { const detail = event.detail, disabled = detail.disabled, index = detail.index, label = detail.label, selected = detail.selected, value = detail.value; // event handling code goes here. })
itemLabelChangeCustomEvent
This event is triggered immediately after an item has been modified and the changes have been saved. It allows you to respond to updates or modifications made to an item's data.
- Bubbles Yes
- Cancelable No
- Interface CustomEvent
- Event handler property onItemLabelChange
Arguments
evCustomEvent
ev.detailObject
ev.detail.selected - Indicates whether the List item is selected or not.
ev.detail.disabled - Indicates whether the List item is disabled or not.
ev.detail.index - The index of the List item that was edited.
ev.detail.label - The label of the edited List item.
ev.detail.value - The value of the List item that was edited.
Methods
isDefaultPrevented
Returns true if the event was prevented by any of its subscribers.
Returns
boolean true if the default action was prevented. Otherwise, returns false.
preventDefault
The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.
stopPropagation
The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
Example
Set up the event handler of itemLabelChange event.
const listbox = document.querySelector('smart-list-box'); listbox.addEventListener('itemLabelChange', function (event) { const detail = event.detail, selected = detail.selected, disabled = detail.disabled, index = detail.index, label = detail.label, value = detail.value; // event handling code goes here. })
scrollBottomReachedCustomEvent
This event is triggered when the user scrolls to the bottom of the list, indicating that the end of the available items has been reached. It can be used to load additional data or perform actions when no more items are visible in the current list view.
- Bubbles Yes
- Cancelable No
- Interface CustomEvent
- Event handler property onScrollBottomReached
Arguments
evCustomEvent
Methods
isDefaultPrevented
Returns true if the event was prevented by any of its subscribers.
Returns
boolean true if the default action was prevented. Otherwise, returns false.
preventDefault
The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.
stopPropagation
The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
Example
Set up the event handler of scrollBottomReached event.
const listbox = document.querySelector('smart-list-box'); listbox.addEventListener('scrollBottomReached', function (event) { // event handling code goes here. })
scrollTopReachedCustomEvent
This event is triggered when the user scrolls to the very top of the list, indicating that the first item in the list is visible or has been reached. It can be used to implement features such as loading previous items, displaying a refresh indicator, or updating the UI when the user navigates to the start of the list.
- Bubbles Yes
- Cancelable No
- Interface CustomEvent
- Event handler property onScrollTopReached
Arguments
evCustomEvent
Methods
isDefaultPrevented
Returns true if the event was prevented by any of its subscribers.
Returns
boolean true if the default action was prevented. Otherwise, returns false.
preventDefault
The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.
stopPropagation
The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
Example
Set up the event handler of scrollTopReached event.
const listbox = document.querySelector('smart-list-box'); listbox.addEventListener('scrollTopReached', function (event) { // event handling code goes here. })
swipeleftCustomEvent
This event is triggered when the user performs a leftward swipe gesture within the boundaries of the listBox component. It can be used to initiate actions such as revealing additional options, deleting a list item, or any other behavior that should occur in response to a left swipe inside the listBox.
- Bubbles Yes
- Cancelable No
- Interface CustomEvent
- Event handler property onSwipeleft
Arguments
evCustomEvent
Methods
isDefaultPrevented
Returns true if the event was prevented by any of its subscribers.
Returns
boolean true if the default action was prevented. Otherwise, returns false.
preventDefault
The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.
stopPropagation
The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
Example
Set up the event handler of swipeleft event.
const listbox = document.querySelector('smart-list-box'); listbox.addEventListener('swipeleft', function (event) { // event handling code goes here. })
swiperightCustomEvent
This event is triggered when the user performs a rightward swipe gesture within the boundaries of the listBox component. It detects intentional swipe actions to the right, allowing developers to respond to user navigation or interaction within the listBox. The event will only fire if the swipe is initiated and completed inside the listBox area.
- Bubbles Yes
- Cancelable No
- Interface CustomEvent
- Event handler property onSwiperight
Arguments
evCustomEvent
Methods
isDefaultPrevented
Returns true if the event was prevented by any of its subscribers.
Returns
boolean true if the default action was prevented. Otherwise, returns false.
preventDefault
The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.
stopPropagation
The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
Example
Set up the event handler of swiperight event.
const listbox = document.querySelector('smart-list-box'); listbox.addEventListener('swiperight', function (event) { // event handling code goes here. })
Methods
appendChild( node: Node): T
Arguments
nodeNode
A ListItem element that should be added to the rest of the items as the last item.
ReturnsNode
add( item: any): void
Adds one or more new items to the collection. This operation updates the data set by appending the provided item(s), making them available for future retrieval or processing.
Arguments
itemany
Describes the properties of the item that will be inserted. You can also pass an array of items.
Invoke the add method.
const listbox = document.querySelector('smart-list-box'); listbox.add("'New item'");
Try a demo showcasing the add method.
clearItems(): void
Clears all items from the listBox, effectively removing every entry and leaving the listBox empty. This operation does not delete the listBox itself, only its contents.
Invoke the clearItems method.
const listbox = document.querySelector('smart-list-box'); listbox.clearItems();
Try a demo showcasing the clearItems method.
clearSelection(): void
Deselects all currently selected items, ensuring that no items remain selected within the list or interface.
Invoke the clearSelection method.
const listbox = document.querySelector('smart-list-box'); listbox.clearSelection();
dataBind(): void
Binds the latest data from the data source to the component, ensuring the user interface reflects current information. This method can be called to refresh or update the displayed data whenever the data source changes.
Invoke the dataBind method.
const listbox = document.querySelector('smart-list-box'); listbox.dataBind();
Try a demo showcasing the dataBind method.
ensureVisible( item: HTMLElement | string): void
Scrolls the container so that the target item is brought into view, ensuring it is fully visible to the user within the viewport or scrollable area.
Arguments
itemHTMLElement | string
A list item or value of the desired item to be visible.
Invoke the ensureVisible method.
const listbox = document.querySelector('smart-list-box'); listbox.ensureVisible("'item1'");
getItem( value: string): HTMLElement
Returns a specific item instance from the listBox based on the provided index or selection criteria. The returned object represents the selected item and includes its associated properties and methods for further manipulation.
Arguments
valuestring
The value of an item from the listBox.
ReturnsHTMLElement
Invoke the getItem method.
const listbox = document.querySelector('smart-list-box'); const result = listbox.getItem("First");
getItems(): {label: string, value: string}[]
Returns an array containing all items currently present in the ListBox component. Each item in the array represents an individual entry within the ListBox, typically as an object with relevant properties such as value, label, and any other associated data. This allows developers to access, display, or manipulate the full set of ListBox options programmatically.
Returns{label: string, value: string}[]
Invoke the getItems method.
const listbox = document.querySelector('smart-list-box'); const result = listbox.getItems();
insert( index: number, items: any): void
Inserts a new item into the collection at the specified index, shifting existing items at and after that position one place to the right. The index determines the position in the array or list where the new item will be placed.
Arguments
indexnumber
The index where the item must be inserted.
itemsany
A single item/definition or an array of List Items/definitions of list items to be inserted. The format of the item definitions is the same as the format of the dataSource property.
Invoke the insert method.
const listbox = document.querySelector('smart-list-box'); listbox.insert(5,"'New item'");
Try a demo showcasing the insert method.
insertBefore( node: Node, referenceNode: Node | null): T
Arguments
nodeNode
A ListItem element that should be added before the referenceItem in the list.
referenceNodeNode | null
A ListItem element that acts as the reference item before which a new item is about to be inserted. The referenceNode must be in the same list as the node.
ReturnsNode
removeAt( index: number): void
Removes the item located at the specified index from the collection or array. The operation shifts all subsequent items one position to the left, effectively reducing the total number of items by one. The specified index must be within the valid range; otherwise, an error may occur.
Arguments
indexnumber
The index of the removed item.
Invoke the removeAt method.
const listbox = document.querySelector('smart-list-box'); listbox.removeAt(5);
Try a demo showcasing the removeAt method.
removeChild( node: Node): T
Arguments
nodeNode
A ListItem element that is part of the list of items inside the element.
ReturnsNode
select( item: string | number | HTMLElement): void
Selects a specific item from the ListBox component by programmatically highlighting or activating it, allowing for interaction as if the user had manually chosen the item from the list.
Arguments
itemstring | number | HTMLElement
A string, representing the value of the item or an HTML Element referencing an item from the list.
Invoke the select method.
const listbox = document.querySelector('smart-list-box'); listbox.select("'First Item'");
unselect( item: string | HTMLElement): void
Removes the selection from a specified item in the listBox component, ensuring that the item is no longer highlighted or considered selected by the application.
Arguments
itemstring | HTMLElement
A string, representing the value of the item or an HTML Element referencing an item from the list
Invoke the unselect method.
const listbox = document.querySelector('smart-list-box'); listbox.unselect("'First Item'");
update( index: number, details: any): void
Updates the properties or content of a specific item within the listBox control. This operation identifies the targeted item based on its index or unique identifier and applies the specified changes, ensuring the listBox reflects the latest data or state.
Arguments
indexnumber
The index of the item that is going to be updated.
detailsany
An object that contains the properties and their new values for the List item that should be updated. For example, label, value or selected attributes.
Invoke the update method.
const listbox = document.querySelector('smart-list-box'); listbox.update(5,"'Updated item'");
Try a demo showcasing the update method.
CSS Variables
--smart-list-box-default-widthvar()
Default value
"var(--smart-editor-width)"smartListBox default width
--smart-list-box-default-heightvar()
Default value
"var(--smart-editor-width)"smartListBox default height
--smart-list-item-group-header-text-transformvar()
Default value
"uppercase"smartListBox item group header text transform
--smart-list-item-horizontal-offsetvar()
Default value
"3px"Defines list item's horizontal offset.
--smart-list-item-vertical-offsetvar()
Default value
"3px"Defines list item's vertical offset.
--smart-list-item-heightvar()
Default value
"36px"smartListBox item height
--smart-list-item-check-box-radiusvar()
Default value
"2px"smartListBox checkbox radius
--smart-list-item-label-paddingvar()
Default value
"0"smartListBox item label padding
--smart-list-item-label-border-radiusvar()
Default value
"0"smartListBox item label border radius
ListItem
Defines a list item for ListBox, ComboBox, DropDownList.
Selector
smart-list-item
Properties
Properties
alternationIndexnumber
Default value
-1colorstring
Default value
""displayMode"plain" | "checkBox" | "radioButton"
Default value
"plain"groupedboolean
Default value
false<smart-list-item grouped></smart-list-item>
selectedboolean
Default value
false<smart-list-item selected></smart-list-item>
valuestring
Default value
""labelstring
Default value
""detailsstring
Default value
""groupstring
Default value
""hiddenboolean
Default value
false<smart-list-item hidden></smart-list-item>
readonlyboolean
Default value
false<smart-list-item readonly></smart-list-item>
ListItemsGroup
Defines a group of list items.
Selector
smart-list-items-group
Properties
Properties
labelstring