Skip to main content

ElementCreateDropdown

Callable

  • ElementCreateDropdown(id: string, Options: readonly string[], ClickEventListener?: (this: HTMLSelectElement, event: Event) => any): HTMLDivElement

  • Creates a dropdown element and adjusts it to the BC look and feel. In the HTML Code this will look like this:

    <div> -- enclosing div used for css and postioning <select> -- the select statement with its options <option 1> <option n> </select> <div></div> -- the div representing the currently selected item <div> -- div for the various options <div>Option 1</div> <div>Option n</div> </div> </div> This construct is built automatically and ignores the original select statement. All the logic is handled by event handlers that are connected to the various divs. See comments in the code. What this function cannot handle at the moment: - The size is always set to 1 - Multiple selects are impossible

    Parameters

    • id: string

      The name of the select item. The outer div will get this name, for positioning. The select tag will get the name ID+"-select"

    • Options: readonly string[]

      The list of options for the current select statement

    • optionalClickEventListener: (this: HTMLSelectElement, event: Event) => any

      An event listener to be called, when the value of the drop down box changes

      Returns HTMLDivElement

      • The created element