@combeenation/custom-code-sdk
    Preparing search index...

    Class Combobox<TValue>

    Type Parameters

    • TValue extends NonNullable<DataListValue>
    Index

    Constructors

    • Type Parameters

      • TValue extends NonNullable<DataListValue>

      Parameters

      • id: string

      Returns Combobox<TValue>

    Properties

    id: string

    Methods

    • See CustomControl.onRendered for detailed information on what you can do with this listener and what it is not meant for. Most of the information there also applies to onGroupHeaderRendered.

      Also see OnRenderedCallback for important information regarding the element which is passed to the callback which also applies here.

      Type Parameters

      • TGroupData

      Parameters

      • callback: (element: HTMLDivElement, groupData: TGroupData) => void

        Callback function which is given the rendered HTML element and the corresponding group data.

                    Typical usage for type safe access to the group data where `IProductGroupsTable` is the auto
                    generated type of the table component from which the combobox groups are populated:
        
                    ```ts
                    combobox.onGroupHeaderRendered<IProductGroupsTable[number]>((el, groupData) => { ... })
                    ```
        

      Returns CallbackUnsubscribeOption

    • Registers a callback that fires when a combobox item is clicked.

      • Fires before onValueChange.
      • Fires even when the clicked item is already selected.

      Type Parameters

      • TItemData

      Parameters

      • callback: (itemData: TItemData, event: MouseEvent) => void

        Callback function which is given the item data of the clicked item and the raw mouse event.

                    Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
                    type of the table component from which the combobox entries are populated:
        
                    ```ts
                    combobox.onItemClicked<IProductsTable[number]>((itemData, event) => { ... })
                    ```
        

      Returns CallbackUnsubscribeOption

    • See CustomControl.onRendered for detailed information on what you can do with this listener and what it is not meant for. Most of the information there also applies to onItemRendered.

      Also see OnRenderedCallback for important information regarding the element which is passed to the callback which also applies here.

      Type Parameters

      • TItemData

      Parameters

      • callback: (element: HTMLDivElement, itemData: TItemData) => void

        Callback function which is given the rendered HTML element and the corresponding item data.

                    Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
                    type of the table component from which the combobox entries are populated:
        
                    ```ts
                    combobox.onItemRendered<IProductsTable[number]>((el, itemData) => { ... })
                    ```
        

      Returns CallbackUnsubscribeOption

    • See CustomControl.onRendered for detailed information on what you can do with this listener and what it is not meant for.

      Also see OnRenderedCallback for important information regarding the element which is passed to the callback.

      Parameters

      Returns CallbackUnsubscribeOption

    • Fires when the selection is committed which is:

      • in single select mode: when the popup closes (or when an option is clicked).
      • in multi select mode: immediately on every selection change.

      Type Parameters

      • TItemData extends any

      Parameters

      • callback: (value: TValue | undefined, valueItemData: TItemData | undefined) => void

        Callback function which is given the raw selection value/keys and the corresponding item data of all the selected items.

                    Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
                    type of the table component from which the combobox entries are populated:
        
                    ```ts
                    // Single selection:
                    combobox.onValueChange<IProductsTable[number]>((value, valueItemData) => { ... })
        
                    // Multi selection:
                    combobox.onValueChange<IProductsTable>((value, valueItemData) => { ... })
                    ```
        

      Returns CallbackUnsubscribeOption

    • See CustomControl.onRendered for detailed information on what you can do with this listener and what it is not meant for. Most of the information there also applies to onValueItemRendered.

      Also see OnRenderedCallback for important information regarding the element which is passed to the callback which also applies here.

      Type Parameters

      • TItemData

      Parameters

      • callback: (element: HTMLDivElement, itemData: TItemData) => void

        Callback function which is given the rendered HTML element and the corresponding item data of the currently selected value item shown in the trigger.

                    Typical usage for type safe access to the item data where `IProductsTable` is the auto generated
                    type of the table component from which the combobox entries are populated:
        
                    ```ts
                    combobox.onValueItemRendered<IProductsTable[number]>((el, itemData) => { ... })
                    ```
        

      Returns CallbackUnsubscribeOption

    • Sets the entries (data items) displayed by the combobox. Existing entries are overwritten.

      Parameters

      • entries: TemplateData[]

      Returns void

    • Sets the group data used to render the group headers of the combobox. Existing group data is overwritten.

      Parameters

      • groupData: TemplateData[]

      Returns void

    • Set arbitrary properties of the combobox control.
      Behavior is the same as when setting the respective property in the configurator editor.

      Some properties are not allowed to be set here because they have a dedicated method which should be used instead.
      E.g. setting visible is not allowed because Combobox.setVisible should be used instead.

      When using properties of type LiquidTemplateSource, you have to manually cast the given string to LiquidTemplateSource like this:

      combobox.setProperty('dataTemplate', '<span>{{ Name }}</span>' as LiquidTemplateSource);
      

      Type Parameters

      • T extends
            | "value"
            | "width"
            | "height"
            | "minWidth"
            | "minHeight"
            | "maxWidth"
            | "maxHeight"
            | "margin"
            | "padding"
            | "cssClasses"
            | "backgroundNormal"
            | "borderRadius"
            | "enabled"
            | "captionPos"
            | "captionText"
            | "flexDirection"
            | "flexWrap"
            | "gap"
            | "placeholder"
            | "dataEntries"
            | "dataTemplate"
            | "valueTemplate"
            | "groupKey"
            | "groupData"
            | "groupTemplate"
            | "tooltipKey"
            | "itemHiddenKey"
            | "itemDisabledKey"
            | "itemCssClassesKey"
            | "filterable"
            | "filterKey"
            | "filterCaptionText"
            | "filterPlaceholder"
            | "clearable"

      Parameters

      • propertyName: T
      • value: SetComboboxPropertyValue[T]

      Returns void

    • Parameters

      • visible: boolean

      Returns Promise<void>