기본 사용법
작업 상태 그리드 탐색
createTableData로 등록한 작업 목록을 표시합니다. 셀을 클릭한 뒤 방향키로 행과 열 사이를 이동해 보세요.
설정과 동작
현재 포커스된 셀 읽기
셀을 클릭하고 방향키로 이동하면 그리드 밖의 요약도 갱신됩니다.
이동에서 제외되는 셀
방향키를 움직여 첫 번째 행의 상태 셀을 건너뜁니다.
행 양끝을 이어서 탐색
이전과 다음 열 버튼을 누르면 강조 표시가 같은 행의 셀을 따라 이동합니다. 행 끝에 도달하면 반대쪽 끝으로 이어집니다.
그리드 행 선택
셀 이동과 별도로 행 전체를 선택합니다.
그리드 정렬
작업 옆 정렬 아이콘을 눌러 행의 순서를 바꿉니다.
그리드의 상태 열 필터
상태 옆 필터 아이콘을 눌러 UISelect에서 ‘대기’를 선택합니다. 선택을 set-query에 연결하면 해당 행만 남습니다.
실전 예제
셀을 눌러 편집하고 확정
상태 값 옆 연필 버튼을 누르세요. Enter로 확정하거나 Escape로 취소합니다.
재고 수량 검증
수량을 편집해 -1을 입력하면 저장이 거부됩니다. 0~999 사이의 정수를 입력해 다시 확정하세요.
예산 편집 후 합계 다시 계산
예산 값 옆 연필 버튼을 눌러 숫자를 바꾸고 Enter로 저장합니다. 월 예산 합계도 바뀝니다.
구성 컴포넌트
구조와 배치
DataGrid.Provider팩토리가 만든 컨트롤러를 같은 컴포넌트 모음에 연결합니다.
현재 포커스된 셀 읽기 예제DataGrid.Root표 또는 그리드의 접근성 역할과 이름을 설정합니다.
현재 포커스된 셀 읽기 예제DataGrid.Header하나 이상의 열 제목 행을 담습니다.
현재 포커스된 셀 읽기 예제DataGrid.HeaderRow같은 단계에 있는 열 제목을 묶습니다.
현재 포커스된 셀 읽기 예제DataGrid.ColumnHeader열이나 제목 그룹을 스키마의 식별자와 연결합니다.
현재 포커스된 셀 읽기 예제DataGrid.Body컨트롤러가 받아들인 행을 렌더링합니다.
현재 포커스된 셀 읽기 예제DataGrid.Row직접 렌더링하는 행을 컨트롤러의 행 id와 연결합니다.
DataGrid.Cell행에 있는 값이나 편집기를 표시합니다.
현재 포커스된 셀 읽기 예제
값 입력과 선택
DataGrid.RowSelectionControl그리드에서 현재 행의 선택을 바꿉니다.
그리드 행 선택 예제DataGrid.BulkSelectionControl검색 범위나 그룹에 포함된 행의 선택을 한꺼번에 바꿉니다.
DataGrid.Editor셀 값을 편집하고 입력한 값을 확정합니다.
재고 수량 검증 예제UITabularEditTrigger편집 가능한 값과 연필 아이콘을 표시하고 클릭하면 셀 편집기에 포커스를 옮깁니다.
셀을 눌러 편집하고 확정 예제
탐색과 동작
DataGrid.SortTrigger열의 정렬 방향을 바꿉니다.
그리드 정렬 예제DataGrid.FilterControl검색 값을 현재 열이나 전체 데이터의 필터에 연결합니다.
DataGrid.ColumnResizeHandle열 너비를 조절합니다.
주요 API
속성과 모델
datacreateTableData로 등록한 열과 행입니다. 테이블과 동일한 열 정의를 그리드에도 전달할 수 있습니다.
작업 상태 그리드 탐색 예제Editor parseValue입력 문자열을 저장할 값으로 변환하거나 실패 결과를 반환합니다.
데이터 소스와 컨트롤러
source렌더링할 행과 각 열의 기능을 반환합니다. capabilities에 edit를 선언한 열은 편집에 진입할 수 있습니다.
현재 포커스된 셀 읽기 예제
슬롯
Body #default현재 행과 편집 상태를 제공합니다.
이벤트와 명령
commit-edit셀과 새 값을 받는 명령입니다. 소스에 값을 반영하고 다시 읽을 수 있습니다.
move-cell현재 셀에서 한 칸 이동합니다. wrap-axis를 지정하면 같은 축의 반대쪽 끝으로 이어집니다.
컴포저블
useDataGrid데이터 소스를 탐색 가능한 그리드 컨트롤러로 연결합니다.
현재 포커스된 셀 읽기 예제useDataGridContext하위 컴포넌트에서 그리드 Provider의 상태를 읽습니다.
현재 포커스된 셀 읽기 예제
팩토리와 유틸리티
createUITabularSource열과 행을 가져오는 함수로 표, 그리드, 트리 그리드에 연결할 데이터 소스를 만듭니다.
셀을 눌러 편집하고 확정 예제createUIDataGridComponents그리드 컨트롤러의 행과 셀에 맞는 Vue 컴포넌트 모음을 만듭니다.
현재 포커스된 셀 읽기 예제
전체 속성, 이벤트와 슬롯
UIDataGrid
label필수stringdata필수TableData<Cells, ID>page-sizenumber | undefined#cell(scope: TableCell<NoInfer<Cells>, NoInfer<ID>>) => VNodeChild
DataGrid.Provider
#default(props: DataGridProviderSlotProps<LeafCells, GroupCells>) => VNodeChild
DataGrid.Root
@commandDataGridCommandHandler@errorDataGridErrorHandlerasPrimitiveAs | undefinedas-childboolean | undefined#default(props: DataGridRootSlotProps<LeafCells, GroupCells>) => VNodeChild
DataGrid.Header
asPrimitiveAs | undefinedas-childboolean | undefined#default(props: DataGridHeaderSlotProps<LeafCells, GroupCells>) => VNodeChild
DataGrid.HeaderRow
asPrimitiveAs | undefinedas-childboolean | undefined#default(props: DataGridHeaderRowSlotProps<LeafCells, GroupCells>) => VNodeChild
DataGrid.ColumnHeader
asPrimitiveAs | undefinedas-childboolean | undefinedheaderstring | undefinedcolumnundefined | DataTableColumnID<LeafCells, GroupCells>#default(props: DataGridColumnHeaderSlotProps<LeafCells, GroupCells>) => VNodeChild
DataGrid.SortTrigger
column필수DataTableColumnID<LeafCells, GroupCells>comparatorstring | undefinedasPrimitiveAs | undefinedas-childboolean | undefined#default(props: DataGridSortTriggerSlotProps<LeafCells, GroupCells>) => VNodeChild
DataGrid.FilterControl
asPrimitiveAs | undefinedas-childboolean | undefinedscope필수"global" | "column"id필수stringpredicate필수stringcolumnDataTableColumnID<LeafCells, GroupCells>#default(props: DataGridFilterControlSlotProps<LeafCells, GroupCells>) => VNodeChild
DataGrid.ColumnResizeHandle
column필수DataTableColumnID<LeafCells, GroupCells>min-sizenumber | undefinedmax-sizenumber | undefinedasPrimitiveAs | undefinedas-childboolean | undefined#default(props: DataGridColumnResizeHandleSlotProps<LeafCells, GroupCells>) => VNodeChild
DataGrid.Body
asPrimitiveAs | undefinedas-childboolean | undefinedrow-attributesReadonly<Record<string, unknown>> | undefinedmanualManual | undefined#default(props: Manual extends true ? DataGridRootSlotProps<LeafCells, GroupCells> : DataGridBodySlotProps<LeafCells, GroupCells>) => VNodeChild#empty(props: DataGridRootSlotProps<LeafCells, GroupCells>) => VNodeChild
DataGrid.Row
row-i-d필수stringasPrimitiveAs | undefinedas-childboolean | undefined#default(props: DataGridRowSlotProps<LeafCells, GroupCells>) => VNodeChild
DataGrid.Cell
row-i-dstring | undefinedcolumn필수DataTableColumnID<LeafCells, GroupCells>asPrimitiveAs | undefinedas-childboolean | undefined#default(props: DataGridCellSlotProps<LeafCells, GroupCells>) => VNodeChild
DataGrid.RowSelectionControl
row-i-dstring | undefinedname필수stringvaluestring | undefinedformstring | undefineddisabledboolean | undefinedasPrimitiveAs | undefinedas-childboolean | undefined#default(props: DataGridRowSelectionControlSlotProps<LeafCells, GroupCells>) => VNodeChild
DataGrid.BulkSelectionControl
target필수{ readonly kind: "all-matching"; } | { readonly kind: "group-leaves"; readonly groupID: string; }disabledboolean | undefinedasPrimitiveAs | undefinedas-childboolean | undefined#default(props: DataGridBulkSelectionControlSlotProps<LeafCells, GroupCells>) => VNodeChild
DataGrid.Editor
parse-value((value: string) => TabularResult<TabularQueryValue>) | undefinedcommit-on-changeboolean | undefinedrow-i-dstring | undefinedcolumn필수DataTableColumnID<LeafCells, GroupCells>asPrimitiveAs | undefinedas-childboolean | undefined#default(props: DataGridEditorSlotProps<LeafCells, GroupCells>) => VNodeChild
UITabularEditTrigger
@click(event: MouseEvent) => any#default(props: {}) => any