Lime Web Components API Documentation - v7.4.0
    Preparing search index...

    Interface Option

    Represents a selectable option in an 'option' or 'set' type property.

    Options are used for dropdown lists, radio buttons, and multi-select fields. Each option has a key (the stored value), text (the displayed text), and an active/inactive state.

    import { PlatformServiceName } from '@limetech/lime-web-components';

    const repository = platform.get(PlatformServiceName.LimeTypeRepository);
    const statusProperty = repository.getLimeType('deal')?.getProperty('status');

    // Inactive options stay out of a dropdown for new selections
    const activeOptions =
    statusProperty?.options?.filter((option) => !option.inactive) ?? [];

    for (const option of activeOptions) {
    // `key` is the stored value, `text` is what the user reads
    console.log(option.key, option.text);
    }
    interface Option {
        id?: number;
        inactive: boolean;
        key: string;
        order?: number;
        text: string;
    }
    Index

    Properties

    id?: number

    Internal database ID of this option. Usually not needed in application code.

    inactive: boolean

    Whether this option is inactive/disabled. Inactive options should not be shown in dropdowns for new selections, but may still appear when displaying existing data.

    key: string

    The value that gets stored in the database. This is the identifier used in code and API calls.

    order?: number

    Display order of this option in lists. Lower numbers appear first.

    text: string

    The user-facing text displayed for this option. This is localized based on the current user's language.