Angular 계층형 그리드 열 선택

    The Column selection feature provides an easy way to select an entire column with a single click. It emphasizes the importance of a particular column by focusing the header cell(s) and everything below. The feature comes with a rich API that allows for manipulation of the selection state, data extraction from the selected fractions and data analysis operations and visualizations.

    Angular Column Selection Example

    아래 샘플은 계층적 그리드의 열 선택 동작의 세 가지 유형을 보여줍니다. 사용 가능한 각 선택 모드를 활성화하려면 아래 열 선택 드롭다운을 사용하세요.

    * 사진Debut 에는 열 선택이 비활성화되어 있습니다.

    Basic usage

    The column selection feature can be enabled through the columnSelection input, which takes GridSelectionMode values.

    상호 작용

    The default selection mode is none. If set to single or multiple all of the presented columns will be selectable. With that being said, in order to select a column, we just need to click on one, which will mark it as selected. If the column is not selectable, no selection style will be applied on the header, while hovering.

    Note

    Multi-column Headers don't reflect on the selectable input. The IgxColumnGroupComponent is selectable, if at least one of its children has the selection behavior enabled. In addition, the component is marked as selected if all of its selectable descendants are selected.

    * 위치 열 그룹 아래에서는 도시 열만 선택할 수 있습니다.

    Keyboard combinations

    Note

    The keyboard combinations are available only when the grid columnSelection input is set to multiple.

    열 선택 기능의 키보드 탐색에는 두 가지 시나리오가 있습니다.

    • 다중 열 선택 - 보유 Ctrl 키 + 딸깍 하는 소리선택 가능 헤더 셀.
    • 범위 열 선택 -Shift 키를 누른 채 클릭하면 사이에서 선택 가능한 모든 열이 선택됩니다.

    API manipulations

    The API provides some additional capabilities when it comes to the non-visible columns such that, every hidden column could be marked as selected by setting the corresponding setter.

    Note

    The above statement also applies to the IgxColumnGroupComponent, except that when the selected property is changed it changes the state of its descendants.

    More information regarding the API manipulations could be found in the API References section.

    스타일링

    스타일링 옵션을 살펴보기 전에 핵심 모듈과 모든 구성 요소 믹스인을 가져와야 합니다.

    @use "igniteui-angular/theming" as *;
    
    // IMPORTANT: Prior to Ignite UI for Angular version 13 use:
    // @import '~igniteui-angular/lib/core/styles/themes/index';
    
    Note

    Please note that row selection and column selection can't be manipulated independently. They depend on the same variables.

    이제 선택호버 스타일을 변경해 보겠습니다.
    가장 간단한 접근 방식에 따라 맞춤 테마를 정의해 보겠습니다.

    $custom-grid-theme: grid-theme(
      $row-selected-background: #011627,
      $row-selected-text-color: #ecaa53,
      $row-selected-hover-background: #011627,
      $header-selected-text-color: #ecaa53,
      $header-selected-background: #011627
    );
    

    The grid-theme accepts several parameters but those are the five responsible for changing the appearance of all selected columns:

    • $row-selected-ground- 선택한 분수의 배경을 설정합니다.
    • $row-selected-text-color- 선택한 분수의 텍스트 색상을 설정합니다.
    • $row-selected-hover-ground- 호버링된 셀 또는 셀 묶음의 색상을 설정합니다.
    • $header-selected-text-color- 선택한 열 헤더의 텍스트 색상을 설정합니다.
    • $header-selected-ground- 선택한 열 헤더의 배경색을 설정합니다.

    Using CSS Variables

    The last step is to include the custom igx-grid theme.

    @include css-vars($custom-grid-theme)
    

    Demo

    Note

    The sample will not be affected by the selected global theme from Change Theme.

    API References

    열 선택 UI에는 아래에 나열된 몇 가지 API가 더 있습니다.

    IgxHierarchicalGridComponent properties:

    IgxColumnComponent properties:

    IgxColumnGrpupComponent properties:

    IgxHierarchicalGridComponent events:

    Additional Resources

    우리 커뮤니티는 활동적이며 항상 새로운 아이디어를 환영합니다.