Web Components ComboBox Features

    Ignite UI for Web Components ComboBox 구성 요소는 필터링 및 그룹화와 같은 여러 기능을 제공합니다.

    Combobox Features Example

    다음 데모는 런타임에 활성화/비활성화되는 기능IgcComboComponent 들을 보여줍니다:

    샘플에서는 컴포넌트를IgcSwitchComponent 사용할 예정이므로, 다음 콤보와 함께 임포트해야 합니다:

    import { defineComponents, IgcComboComponent, IgcSwitchComponent } from 'igniteui-webcomponents';
    import 'igniteui-webcomponents/themes/light/bootstrap.css';
    
    defineComponents(IgcComboComponent, IgcSwitchComponent);
    
    let combo = document.getElementById('combo') as IgcComboComponent<City>;
    
    let switchIcon = document.getElementById('caseSensitive') as IgcSwitchComponent;
    let switchFilter = document.getElementById('filtering') as IgcSwitchComponent;
    let switchDisable = document.getElementById('disabled') as IgcSwitchComponent;
    
    switchIcon.addEventListener("igcChange", () => {
        combo.caseSensitiveIcon = switchIcon.checked;
    });
    
    switchFilter.addEventListener("igcChange", () => {
        combo.disableFiltering = switchIcon.disabled = switchFilter.checked;
    });
    
    switchDisable.addEventListener("igcChange", () => {
        combo.disabled = switchDisable.checked;
    });
    

    그룹화는 해당 데이터 소스 필드에 속성을 설정groupKey 하여 활성화/비활성화할 수 있음을 참고하세요:

    let switchGroup = document.getElementById('grouping') as IgcSwitchComponent;
    
    switchGroup.addEventListener("igcChange", () => {
        this.combo.groupKey = switchGroup.checked ? "country" : undefined;
    });
    

    특징

    필터링

    기본적으로 ComboBox의 필터링이 활성화되어 있습니다. 속성을 설정disableFiltering 하면 비활성화할 수 있습니다.

    필터링 옵션은 검색 케이스 민감도를 활성화하여 더욱 강화할 수 있습니다. 이 속성을 통해caseSensitiveIcon 대소문자 구분 아이콘을 켤 수 있어 최종 사용자가 대소문자 민감도를 제어할 수 있습니다.

    <igc-combo disable-filtering case-sensitive-icon></igc-combo>
    

    필터링 옵션

    The Ignite UI for Web Components IgcComboComponent exposes one more filtering property that allows passing configuration of both FilterKey and CaseSensitive options. The FilterKey indicates which data source field should be used for filtering the list of options. The CaseSensitive option indicates if the filtering should be case-sensitive or not.

    다음 코드 조각은 이름 대신 국가별로 데이터 소스의 도시를 필터링하는 방법을 보여줍니다. 또한 기본적으로 필터링에서 대소문자를 구분하도록 설정하고 있습니다.

    const options = {
        filterKey: 'country',
        caseSensitive: true
    };
    
    combo.filteringOptions = options;
    

    Grouping

    옵션을 정의하면groupKey 제공된 키에 따라 항목들을 그룹화합니다:

    <igc-combo group-key="region"></igc-combo>
    

    [!Note] The groupKey property will only have effect if your data source consists of complex objects.

    정렬 방향

    ComboBox 구성 요소는 그룹을 오름차순으로 정렬해야 하는지 내림차순으로 정렬해야 하는지 설정하는 옵션도 제공합니다. 기본적으로 정렬 순서는 오름차순입니다.

    <igc-combo group-sorting="desc"></igc-combo>
    

    Label

    라벨은IgcComboComponent 다음과label 같은 속성을 사용하여 쉽게 설정할 수 있습니다:

    <igc-combo label="Cities"></igc-combo>
    

    Placeholder

    ComboBox 구성 요소 입력과 드롭다운 메뉴 내에 있는 검색 입력 모두에 대해 자리 표시자 텍스트를 지정할 수 있습니다.

    <igc-combo placeholder="Pick a city" placeholder-search="Search for a city"></igc-combo>
    

    Autofocus

    페이지 로드 시 ComboBox에 자동으로 초점을 맞추려면 다음 코드를 사용할 수 있습니다.

    <igc-combo autofocus></igc-combo>
    

    Search Input Focus

    ComboBox 검색 입력은 기본적으로 집중되어 있습니다. 이 기능을 비활성화하고 포커스를 옵션 목록으로 이동하려면 아래에 표시된 속성을 사용autofocusList 하세요:

    <igc-combo autofocus-list></igc-combo>
    

    Required

    필수 속성을 설정하여 ComboBox를 필수로 표시할 수 있습니다.

    <igc-combo required></igc-combo>
    

    Disable ComboBox

    ComboBox는 다음 속성으로disabled 비활성화할 수 있습니다:

    <igc-combo disabled></igc-combo>
    

    API Reference

    Additional Resources