new H_ui_autocomplete(dom_id)
ui.js, line 2607
| Name | Type | Description |
|---|---|---|
dom_id |
string | dom_id for the created autocomplete |
Members
-
instances
-
All autocomplete instances by dom_id (own registry, see H_ui_completer).
Methods
-
can_open(){boolean}
ui.js, line 2678 -
The list is only opened when it has a row to show: an autocomplete without result stays closed.
Returns:
Type Description boolean -
display_search_result(result, open)
ui.js, line 2737 -
Displays the search results in the dropdown.
Adds event listeners to each result item for selection.Name Type Description resultstring HTML string of results. openboolean Whether to open the dropdown. -
get_active_element(){HTMLElement|false}
ui.js, line 2670 -
The active row is held by position in the list, not by reference.
Returns:
Type Description HTMLElement | false -
on_click_search_result(evt)
ui.js, line 2753 -
Handles click event on a search result item.
Sets the value, closes the dropdown, and triggers callback or confirmation if needed.
Name Type Description evtEvent The click event. -
on_focus(evt)
ui.js, line 2687 -
Handles focus event on the input field.
Opens the autocomplete dropdown with show()Name Type Description evtEvent The focus event. -
on_hover_search_result(evt)
ui.js, line 2779 -
Handles mouse hover on a search result item.
Updates the active (highlighted) result.Name Type Description evtEvent The mousemove event. -
on_input(open)
ui.js, line 2695 -
Handles input event on the search field.
Sends AJAX request if input length > 1 and displays results.
Name Type Default Description openboolean true optional Whether to open the dropdown after input. -
on_key_down(evt)
ui.js, line 2795 -
Handles keydown events for navigation and selection.
Supports ArrowUp, ArrowDown, Enter, and new value logic.Name Type Description evtKeyboardEvent The keyboard event.