Web Components 트리 그리드의 Ignite UI for Web Components 축소 가능한 열 그룹 기능을 사용하면 중첩된 열 및 열 그룹을 함께 그룹화하고 이러한 그룹을 축소하거나 확장할 수 있는 옵션을 제공하여 데이터 시각화 및 탐색을 개선할 수 있도록 여러 수준의 중첩 열 및 열 그룹을 IgcTreeGridComponent 구성하고 관리할 수 있습니다.
<!DOCTYPE html><html><head><title>Sample | Ignite UI | Web Components | infragistics</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png" ><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css" /><linkrel="stylesheet"href="/src/index.css"type="text/css" /></head><body><divid="root"><divclass="container sample ig-typography"><divclass="container fill"><igc-tree-gridauto-generate="false"name="treeGrid"id="treeGrid"id="treeGrid"primary-key="ID"foreign-key="ParentID"moving="true"row-selection="none"><igc-column-groupheader="General Information"collapsible="true"expanded="false"pinned="false"><igc-columnfield="Name"header="Full Name"data-type="string"sortable="true"resizable="true"width="200"visible-when-collapsed="false"></igc-column><igc-columnfield="LastName"header="Last Name"data-type="string"sortable="true"resizable="true"width="200"visible-when-collapsed="true"></igc-column><igc-columnfield="Title"width="250"data-type="string"sortable="true"resizable="true"></igc-column><igc-columnfield="ID"data-type="number"resizable="true"filterable="false"visible-when-collapsed="false"></igc-column><igc-columnfield="HireDate"data-type="date"sortable="true"resizable="true"visible-when-collapsed="false"></igc-column><igc-columnfield="Age"data-type="number"sortable="true"resizable="true"visible-when-collapsed="false"></igc-column></igc-column-group><igc-column-groupheader="Address Information"><igc-column-groupheader="Location"collapsible="true"><igc-columnfield="FullAddress"width="300"data-type="string"sortable="true"resizable="true"visible-when-collapsed="true"></igc-column><igc-columnfield="Country"data-type="string"sortable="true"resizable="true"visible-when-collapsed="false"></igc-column><igc-columnfield="City"data-type="string"sortable="true"resizable="true"visible-when-collapsed="false"></igc-column><igc-columnfield="Address"data-type="string"sortable="true"resizable="true"visible-when-collapsed="false"></igc-column></igc-column-group><igc-column-groupheader="Contact Information"><igc-columnfield="Phone"data-type="string"sortable="true"resizable="true"></igc-column><igc-columnfield="Fax"data-type="string"sortable="true"resizable="true"></igc-column><igc-columnfield="PostalCode"data-type="string"sortable="true"resizable="true"></igc-column></igc-column-group></igc-column-group></igc-tree-grid></div></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
Ignite UI for Web Components에 대한 전체 소개를 보려면 시작하기 항목을 읽어보세요.
또한 그리드에서 열 그룹을 설정하는 방법에 대한 자세한 내용을 보려면 다중 열 헤더 항목을 간략하게 살펴보는 것이 좋습니다.
용법
축소 가능한 열 그룹은 열 그룹을 더 작은 데이터 세트로 축소/확장하는 방법을 제공하는 다중 열 헤더 기능의 일부입니다. 열 그룹이 축소되면 열의 하위 집합이 최종 사용자에게 표시되고 그룹의 다른 하위 열은 숨겨집니다. 축소/확장된 각 열은 그리드 데이터 소스에 바인딩되거나 바인딩 해제되어 계산될 수 있습니다.
열 그룹을 축소 가능한 것으로 정의하려면 를 설정해야 합니다. Collapsible의 속성 columnGroup 받는 사람 참.
<igc-column-groupheader="Customer Information"collapsible="true"><!-- Initially the column groups will be expanded---><!--The column below will be visible when its parent is collapsed--><igc-columnfield="CustomerName"header="Fullname"data-type="String"visible-when-collapsed="true"></igc-column><!--The three columns below will be visible when its parent is expanded--><igc-columnfield="CustomerID"header="Customer ID"data-type="String"visible-when-collapsed="false"></igc-column><igc-columnfield="FirstName"header="First Name"data-type="String"visible-when-collapsed="false"></igc-column><igc-columnfield="LastName"header="Last Name"data-type="String"visible-when-collapsed="false"></igc-column><igc-column-groupheader="Customer Address"><!--This column visibility will not be changed based on parent expand/collapsed state--><igc-columnfield="Country"header="Country"data-type="String"sortable="true"></igc-column><igc-columnfield="City"header="City"data-type="String"sortable="true"></igc-column></igc-column-group></igc-column-group>html
요약하면 모든 하위 열에는 세 가지 상태가 있습니다.
상위 항목의 확장 상태에 관계없이 항상 표시될 수 있습니다.
상위 항목이 축소되면 표시될 수 있습니다.
상위 항목이 축소되면 숨길 수 있습니다.
축소 가능으로 지정된 열 그룹의 초기 상태는 다음과 같습니다. Expanded로 설정 진실로 설정하여 이 동작을 쉽게 변경할 수 있습니다. 거짓.