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

    Class Dataview<TValue>

    Type Parameters

    • TValue extends NonNullable<DataListValue>
    Index

    Constructors

    • Type Parameters

      • TValue extends NonNullable<DataListValue>

      Parameters

      • id: string

      Returns Dataview<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 dataview groups are populated:
        
                    ```ts
                    dataview.onGroupHeaderRendered<IProductGroupsTable[number]>((el, groupData) => { ... })
                    ```
        

      Returns CallbackUnsubscribeOption

    • Registers a callback that fires when a datalist 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 rendered 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 dataview entries are populated:
        
                    ```ts
                    dataview.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 dataview entries are populated:
        
                    ```ts
                    dataview.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

    • 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 dataview entries are populated:
        
                    ```ts
                    // Single selection list:
                    dataview.onValueChange<IProductsTable[number]>(value, valueItemData) => { ... }
        
                    // Multi selection list:
                    dataview.onValueChange<IProductsTable>(value, valueItemData) => { ... }
                    ```
        

      Returns CallbackUnsubscribeOption

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

      Parameters

      • entries: TemplateData[]

      Returns void

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

      Parameters

      • groupData: TemplateData[]

      Returns void

    • Set arbitrary properties of the dataview 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 Dataview.setVisible should be used instead.

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

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

      Type Parameters

      • T extends
            | "value"
            | "margin"
            | "padding"
            | "cssClasses"
            | "flexDirection"
            | "flexWrap"
            | "gap"
            | "dataEntries"
            | "dataTemplate"
            | "groupKey"
            | "groupData"
            | "groupTemplate"
            | "tooltipKey"
            | "itemHiddenKey"
            | "itemDisabledKey"
            | "itemCssClassesKey"
            | "filterable"
            | "filterKey"
            | "filterCaptionText"
            | "filterPlaceholder"
            | "allowDeselect"

      Parameters

      • propertyName: T
      • value: SetDataviewPropertyValue[T]

      Returns void

    • Parameters

      • visible: boolean

      Returns Promise<void>