mithril-materialized
    Preparing search index...

    Interface SelectAttrs<T>

    interface SelectAttrs<T extends string | number> {
        checkedId?: T | T[];
        class?: string;
        className?: string;
        defaultCheckedId?: T | T[];
        disabled?: boolean;
        helperText?: string;
        iconName?: string;
        id?: string;
        isMandatory?: boolean;
        key?: string | number;
        label?: string;
        multiple?: boolean;
        newRow?: boolean;
        onchange?: (checkedIds: T[]) => void;
        options: InputOption<T>[];
        placeholder?: string;
        required?: boolean;
        showClearButton?: boolean;
        style?: string;
        onbeforeremove?(this: any, vnode: VnodeDOM<any, any>): void | Promise<any>;
        onbeforeupdate?(
            this: any,
            vnode: Vnode<any, any>,
            old: VnodeDOM<any, any>,
        ): boolean | void;
        oncreate?(this: any, vnode: VnodeDOM<any, any>): any;
        oninit?(this: any, vnode: Vnode<any, any>): any;
        onremove?(this: any, vnode: VnodeDOM<any, any>): any;
        onupdate?(this: any, vnode: VnodeDOM<any, any>): any;
        [property: string]: any;
    }

    Type Parameters

    • T extends string | number

    Hierarchy (View Summary)

    Indexable

    • [property: string]: any

      Any other virtual element properties, including attributes and event handlers.

    Index

    Properties

    checkedId?: T | T[]

    Currently selected id or ids. For controlled mode, pass the current selection and provide onchange. For single select, pass a single value or array with one item. For multiple select, pass an array of selected ids.

    class?: string

    The class name(s) for this virtual element, as a space-separated list.

    className?: string

    The class name(s) for this virtual element, as a space-separated list.

    defaultCheckedId?: T | T[]

    Default selected id or ids for uncontrolled mode. Only used when checkedId and onchange are not provided. The component will manage its own internal state in uncontrolled mode.

    disabled?: boolean

    Sets the input field to disabled.

    helperText?: string

    Add a description underneath the input field.

    iconName?: string

    Uses Materialize icons as a prefix or postfix.

    id?: string

    Optional ID.

    isMandatory?: boolean

    If true, add a mandatory * after the label (if any), and add the required and aria-required attributes to the input element.

    key?: string | number

    Unique key for use of the element in an array.

    label?: string

    Optional label.

    multiple?: boolean

    Select a single option or multiple options

    newRow?: boolean

    If true, break to a new row

    onchange?: (checkedIds: T[]) => void

    Called when the selection changes, contains all selected (checked) ids as an array

    options: InputOption<T>[]

    Options to select from

    placeholder?: string

    Add a a placeholder to the input field.

    required?: boolean

    Add the required and aria-required attributes to the input element

    showClearButton?: boolean

    Enable the clear icon

    style?: string

    Optional style information.

    Methods

    • The onbeforeremove hook is called before a DOM element is detached from the document. If a Promise is returned, Mithril only detaches the DOM element after the promise completes.

      Parameters

      • this: any
      • vnode: VnodeDOM<any, any>

      Returns void | Promise<any>

    • The onbeforeupdate hook is called before a vnode is diffed in a update.

      Parameters

      • this: any
      • vnode: Vnode<any, any>
      • old: VnodeDOM<any, any>

      Returns boolean | void

    • The oncreate hook is called after a DOM element is created and attached to the document.

      Parameters

      • this: any
      • vnode: VnodeDOM<any, any>

      Returns any

    • The oninit hook is called before a vnode is touched by the virtual DOM engine.

      Parameters

      • this: any
      • vnode: Vnode<any, any>

      Returns any

    • The onremove hook is called before a DOM element is removed from the document.

      Parameters

      • this: any
      • vnode: VnodeDOM<any, any>

      Returns any

    • The onupdate hook is called after a DOM element is updated, while attached to the document.

      Parameters

      • this: any
      • vnode: VnodeDOM<any, any>

      Returns any