펼침 아이콘과 안내선 바꾸기Change the expand icons and guide lines
화살표 대신 폴더, +/- 같은 기본 아이콘 세트를 고르거나 열림·닫힘·잎 아이콘을 직접 정할 수 있어요. 들여쓰기 안내선의 종류와 모양도 바꿀 수 있어요.Pick a built-in icon set such as folder or +/-, or define the open, closed and leaf icons yourself. The indent guide lines can change too.
코드Code
탭을 골라 코드를 복사하세요. 위 화면은 이 코드를 그대로 실행한 결과예요.Pick a tab and copy the code. The preview above runs exactly this code.
이 화면은 새 모양 옵션을 켠 모양이에요: density: 'spacious', iconStyle: 'soft', motion: true (코드에 없으면 기본 모양으로 보여요)This preview has the new-look options on: density: 'spacious', iconStyle: 'soft', motion: true (without them in your code you get the default look)
버튼을 누르면 이 예제의 코드가 StackBlitz나 CodeSandbox로 전송돼요. 누르기 전에는 아무것도 보내지 않아요.
<div id="app">
<div class="toolbar">
<select aria-label="펼침 아이콘" id="icon">
<option value="arrow" selected>화살표</option>
<option value="folder">폴더</option>
<option value="plusMinus">+ / -</option>
<option value="plusMinusCircle">원 안의 + / -</option>
<option value="emoji">직접 정한 아이콘</option>
</select>
<select aria-label="안내선" id="guides">
<option value="dotted" selected>점선</option>
<option value="solid">실선</option>
<option value="off">없음</option>
</select>
<select aria-label="안내선 모양" id="shape">
<option value="branch" selected>가지선</option>
<option value="vertical">세로선만</option>
</select>
</div>
<div id="grid" style="height: 430px"></div>
</div>
<script type="module" src="./main.js"></script>import { createGrid } from 'maxgrid';
import { actions, options } from './example';
const api = createGrid(document.getElementById('grid'), options);
document.getElementById('icon').addEventListener('change', (event) => actions.icon(api, event.target.value));
document.getElementById('guides').addEventListener('change', (event) => actions.guides(api, event.target.value));
document.getElementById('shape').addEventListener('change', (event) => actions.shape(api, event.target.value));const rows = [
{
id: 'T1',
parentId: null,
task: '출시 준비',
owner: '김서연',
start: '2026-11-02',
end: '2026-12-18',
},
{
id: 'T10',
parentId: 'T1',
task: '기획',
owner: '이준호',
start: '2026-11-02',
end: '2026-11-13',
},
{
id: 'T11',
parentId: 'T10',
task: '요구사항 정리',
owner: '이준호',
start: '2026-11-02',
end: '2026-11-06',
},
{
id: 'T12',
parentId: 'T10',
task: '화면 설계',
owner: '박민지',
start: '2026-11-09',
end: '2026-11-13',
},
{
id: 'T20',
parentId: 'T1',
task: '개발',
owner: '최도윤',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T21',
parentId: 'T20',
task: '프런트엔드',
owner: '정하은',
start: '2026-11-16',
end: '2026-11-27',
},
{
id: 'T22',
parentId: 'T20',
task: '백엔드',
owner: '최도윤',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T30',
parentId: 'T1',
task: '테스트',
owner: '박민지',
start: '2026-12-07',
end: '2026-12-18',
},
{
id: 'T31',
parentId: 'T30',
task: '기능 테스트',
owner: '박민지',
start: '2026-12-07',
end: '2026-12-11',
},
{
id: 'T32',
parentId: 'T30',
task: '성능 테스트',
owner: '임태민',
start: '2026-12-14',
end: '2026-12-18',
},
{
id: 'T2',
parentId: null,
task: '운영 준비',
owner: '김서연',
start: '2026-12-07',
end: '2026-12-23',
},
{
id: 'T40',
parentId: 'T2',
task: '교육 자료 작성',
owner: '한지우',
start: '2026-12-07',
end: '2026-12-11',
},
];
let icon = 'arrow';
let guides = 'dotted';
let shape = 'branch';
// 펼침 아이콘은 세트 이름('folder' 등)으로 고르거나, 열림·닫힘·잎 아이콘을 직접 정할 수 있어요.
const toggleIcon = () => icon === 'emoji' ? { expanded: '📂', collapsed: '📁', leaf: '📄' } : icon;
const tree = () => ({
parentKey: 'parentId',
column: 'task',
expandDepth: 'all',
toggleIcon: toggleIcon(),
guides,
guideStyle: shape,
});
export const options = {
columns: [
{ id: 'task', title: '작업', width: 220 },
{ id: 'owner', title: '담당자', width: 100 },
{ id: 'start', title: '시작', width: 110 },
{ id: 'end', title: '종료', width: 110 },
],
rows,
rowKey: 'id',
tree: tree(),
};
export const actions = {
icon: (api, value) => {
icon = (value ?? 'arrow');
api.setOptions({ tree: tree() });
},
guides: (api, value) => {
guides = value === 'off' ? false : value === 'solid' ? 'solid' : 'dotted';
api.setOptions({ tree: tree() });
},
shape: (api, value) => {
shape = value === 'vertical' ? 'vertical' : 'branch';
api.setOptions({ tree: tree() });
},
};<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>펼침 아이콘과 안내선 바꾸기</title>
</head>
<body>
<div class="toolbar">
<select aria-label="펼침 아이콘" id="icon">
<option value="arrow" selected>화살표</option>
<option value="folder">폴더</option>
<option value="plusMinus">+ / -</option>
<option value="plusMinusCircle">원 안의 + / -</option>
<option value="emoji">직접 정한 아이콘</option>
</select>
<select aria-label="안내선" id="guides">
<option value="dotted" selected>점선</option>
<option value="solid">실선</option>
<option value="off">없음</option>
</select>
<select aria-label="안내선 모양" id="shape">
<option value="branch" selected>가지선</option>
<option value="vertical">세로선만</option>
</select>
</div>
<div id="grid" style="height: 430px"></div>
<script src="https://cdn.maxmine.com/maxgrid/latest/maxgrid.min.js"></script>
<script>
const rows = [
{
id: 'T1',
parentId: null,
task: '출시 준비',
owner: '김서연',
start: '2026-11-02',
end: '2026-12-18',
},
{
id: 'T10',
parentId: 'T1',
task: '기획',
owner: '이준호',
start: '2026-11-02',
end: '2026-11-13',
},
{
id: 'T11',
parentId: 'T10',
task: '요구사항 정리',
owner: '이준호',
start: '2026-11-02',
end: '2026-11-06',
},
{
id: 'T12',
parentId: 'T10',
task: '화면 설계',
owner: '박민지',
start: '2026-11-09',
end: '2026-11-13',
},
{
id: 'T20',
parentId: 'T1',
task: '개발',
owner: '최도윤',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T21',
parentId: 'T20',
task: '프런트엔드',
owner: '정하은',
start: '2026-11-16',
end: '2026-11-27',
},
{
id: 'T22',
parentId: 'T20',
task: '백엔드',
owner: '최도윤',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T30',
parentId: 'T1',
task: '테스트',
owner: '박민지',
start: '2026-12-07',
end: '2026-12-18',
},
{
id: 'T31',
parentId: 'T30',
task: '기능 테스트',
owner: '박민지',
start: '2026-12-07',
end: '2026-12-11',
},
{
id: 'T32',
parentId: 'T30',
task: '성능 테스트',
owner: '임태민',
start: '2026-12-14',
end: '2026-12-18',
},
{
id: 'T2',
parentId: null,
task: '운영 준비',
owner: '김서연',
start: '2026-12-07',
end: '2026-12-23',
},
{
id: 'T40',
parentId: 'T2',
task: '교육 자료 작성',
owner: '한지우',
start: '2026-12-07',
end: '2026-12-11',
},
];
let icon = 'arrow';
let guides = 'dotted';
let shape = 'branch';
// 펼침 아이콘은 세트 이름('folder' 등)으로 고르거나, 열림·닫힘·잎 아이콘을 직접 정할 수 있어요.
const toggleIcon = () => icon === 'emoji' ? { expanded: '📂', collapsed: '📁', leaf: '📄' } : icon;
const tree = () => ({
parentKey: 'parentId',
column: 'task',
expandDepth: 'all',
toggleIcon: toggleIcon(),
guides,
guideStyle: shape,
});
const options = {
columns: [
{ id: 'task', title: '작업', width: 220 },
{ id: 'owner', title: '담당자', width: 100 },
{ id: 'start', title: '시작', width: 110 },
{ id: 'end', title: '종료', width: 110 },
],
rows,
rowKey: 'id',
tree: tree(),
};
const actions = {
icon: (api, value) => {
icon = (value ?? 'arrow');
api.setOptions({ tree: tree() });
},
guides: (api, value) => {
guides = value === 'off' ? false : value === 'solid' ? 'solid' : 'dotted';
api.setOptions({ tree: tree() });
},
shape: (api, value) => {
shape = value === 'vertical' ? 'vertical' : 'branch';
api.setOptions({ tree: tree() });
},
};
options.ariaLabel = "펼침 아이콘과 안내선 바꾸기";
const api = MaxGrid.createGrid(document.getElementById('grid'), options);
document.getElementById('icon').addEventListener('change', (event) => actions.icon(api, event.target.value));
document.getElementById('guides').addEventListener('change', (event) => actions.guides(api, event.target.value));
document.getElementById('shape').addEventListener('change', (event) => actions.shape(api, event.target.value));
</script>
</body>
</html>버튼을 누르면 이 예제의 코드가 StackBlitz나 CodeSandbox로 전송돼요. 누르기 전에는 아무것도 보내지 않아요.
import { Grid, useGridApi } from '@maxgrid/react';
import { actions, options, type Row } from './example';
export function ExampleGrid() {
const [api, gridRef] = useGridApi<Row>();
return (
<>
<div className="toolbar">
<select
aria-label="펼침 아이콘"
disabled={!api}
onChange={(event) => api && actions.icon(api, event.target.value)}
>
<option value="arrow">화살표</option>
<option value="folder">폴더</option>
<option value="plusMinus">+ / -</option>
<option value="plusMinusCircle">원 안의 + / -</option>
<option value="emoji">직접 정한 아이콘</option>
</select>
<select defaultValue="arrow"
aria-label="안내선"
disabled={!api}
onChange={(event) => api && actions.guides(api, event.target.value)}
>
<option value="dotted">점선</option>
<option value="solid">실선</option>
<option value="off">없음</option>
</select>
<select defaultValue="dotted"
aria-label="안내선 모양"
disabled={!api}
onChange={(event) => api && actions.shape(api, event.target.value)}
>
<option value="branch">가지선</option>
<option value="vertical">세로선만</option>
</select>
</div>
<Grid style={{ height: 430 }} ref={gridRef} options={options} />
</>
);
}import type { GridApi, GridOptions } from '@maxgrid/react';
export interface Row {
id: string;
parentId: string | null;
task: string;
owner: string;
start: string;
end: string;
}
const rows: Row[] = [
{
id: 'T1',
parentId: null,
task: '출시 준비',
owner: '김서연',
start: '2026-11-02',
end: '2026-12-18',
},
{
id: 'T10',
parentId: 'T1',
task: '기획',
owner: '이준호',
start: '2026-11-02',
end: '2026-11-13',
},
{
id: 'T11',
parentId: 'T10',
task: '요구사항 정리',
owner: '이준호',
start: '2026-11-02',
end: '2026-11-06',
},
{
id: 'T12',
parentId: 'T10',
task: '화면 설계',
owner: '박민지',
start: '2026-11-09',
end: '2026-11-13',
},
{
id: 'T20',
parentId: 'T1',
task: '개발',
owner: '최도윤',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T21',
parentId: 'T20',
task: '프런트엔드',
owner: '정하은',
start: '2026-11-16',
end: '2026-11-27',
},
{
id: 'T22',
parentId: 'T20',
task: '백엔드',
owner: '최도윤',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T30',
parentId: 'T1',
task: '테스트',
owner: '박민지',
start: '2026-12-07',
end: '2026-12-18',
},
{
id: 'T31',
parentId: 'T30',
task: '기능 테스트',
owner: '박민지',
start: '2026-12-07',
end: '2026-12-11',
},
{
id: 'T32',
parentId: 'T30',
task: '성능 테스트',
owner: '임태민',
start: '2026-12-14',
end: '2026-12-18',
},
{
id: 'T2',
parentId: null,
task: '운영 준비',
owner: '김서연',
start: '2026-12-07',
end: '2026-12-23',
},
{
id: 'T40',
parentId: 'T2',
task: '교육 자료 작성',
owner: '한지우',
start: '2026-12-07',
end: '2026-12-11',
},
];
type IconName = 'arrow' | 'folder' | 'plusMinus' | 'plusMinusCircle' | 'emoji';
type Guides = false | 'dotted' | 'solid';
let icon: IconName = 'arrow';
let guides: Guides = 'dotted';
let shape: 'branch' | 'vertical' = 'branch';
// 펼침 아이콘은 세트 이름('folder' 등)으로 고르거나, 열림·닫힘·잎 아이콘을 직접 정할 수 있어요.
const toggleIcon = () =>
icon === 'emoji' ? { expanded: '📂', collapsed: '📁', leaf: '📄' } : icon;
const tree = () => ({
parentKey: 'parentId' as const,
column: 'task',
expandDepth: 'all' as const,
toggleIcon: toggleIcon(),
guides,
guideStyle: shape,
});
export const options: GridOptions<Row> = {
columns: [
{ id: 'task', title: '작업', width: 220 },
{ id: 'owner', title: '담당자', width: 100 },
{ id: 'start', title: '시작', width: 110 },
{ id: 'end', title: '종료', width: 110 },
],
rows,
rowKey: 'id',
tree: tree(),
};
export const actions = {
icon: (api: GridApi<Row>, value?: string) => {
icon = (value ?? 'arrow') as IconName;
api.setOptions({ tree: tree() });
},
guides: (api: GridApi<Row>, value?: string) => {
guides = value === 'off' ? false : value === 'solid' ? 'solid' : 'dotted';
api.setOptions({ tree: tree() });
},
shape: (api: GridApi<Row>, value?: string) => {
shape = value === 'vertical' ? 'vertical' : 'branch';
api.setOptions({ tree: tree() });
},
};버튼을 누르면 이 예제의 코드가 StackBlitz나 CodeSandbox로 전송돼요. 누르기 전에는 아무것도 보내지 않아요.
<script setup lang="ts">
import { shallowRef } from 'vue';
import { Grid, type GridApi } from '@maxgrid/vue';
import { actions, options, type Row } from './example';
const api = shallowRef<GridApi<Row> | null>(null);
function onReady(event: { api: GridApi<Row> }) {
api.value = event.api;
}
</script>
<template>
<div class="toolbar">
<select
aria-label="펼침 아이콘"
:disabled="!api"
@change="api && actions.icon(api, ($event.target as HTMLSelectElement).value)"
>
<option value="arrow" selected>화살표</option>
<option value="folder">폴더</option>
<option value="plusMinus">+ / -</option>
<option value="plusMinusCircle">원 안의 + / -</option>
<option value="emoji">직접 정한 아이콘</option>
</select>
<select
aria-label="안내선"
:disabled="!api"
@change="api && actions.guides(api, ($event.target as HTMLSelectElement).value)"
>
<option value="dotted" selected>점선</option>
<option value="solid">실선</option>
<option value="off">없음</option>
</select>
<select
aria-label="안내선 모양"
:disabled="!api"
@change="api && actions.shape(api, ($event.target as HTMLSelectElement).value)"
>
<option value="branch" selected>가지선</option>
<option value="vertical">세로선만</option>
</select>
</div>
<Grid style="height: 430px" :options="options" @ready="onReady" />
</template>import type { GridApi, GridOptions } from '@maxgrid/vue';
export interface Row {
id: string;
parentId: string | null;
task: string;
owner: string;
start: string;
end: string;
}
const rows: Row[] = [
{
id: 'T1',
parentId: null,
task: '출시 준비',
owner: '김서연',
start: '2026-11-02',
end: '2026-12-18',
},
{
id: 'T10',
parentId: 'T1',
task: '기획',
owner: '이준호',
start: '2026-11-02',
end: '2026-11-13',
},
{
id: 'T11',
parentId: 'T10',
task: '요구사항 정리',
owner: '이준호',
start: '2026-11-02',
end: '2026-11-06',
},
{
id: 'T12',
parentId: 'T10',
task: '화면 설계',
owner: '박민지',
start: '2026-11-09',
end: '2026-11-13',
},
{
id: 'T20',
parentId: 'T1',
task: '개발',
owner: '최도윤',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T21',
parentId: 'T20',
task: '프런트엔드',
owner: '정하은',
start: '2026-11-16',
end: '2026-11-27',
},
{
id: 'T22',
parentId: 'T20',
task: '백엔드',
owner: '최도윤',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T30',
parentId: 'T1',
task: '테스트',
owner: '박민지',
start: '2026-12-07',
end: '2026-12-18',
},
{
id: 'T31',
parentId: 'T30',
task: '기능 테스트',
owner: '박민지',
start: '2026-12-07',
end: '2026-12-11',
},
{
id: 'T32',
parentId: 'T30',
task: '성능 테스트',
owner: '임태민',
start: '2026-12-14',
end: '2026-12-18',
},
{
id: 'T2',
parentId: null,
task: '운영 준비',
owner: '김서연',
start: '2026-12-07',
end: '2026-12-23',
},
{
id: 'T40',
parentId: 'T2',
task: '교육 자료 작성',
owner: '한지우',
start: '2026-12-07',
end: '2026-12-11',
},
];
type IconName = 'arrow' | 'folder' | 'plusMinus' | 'plusMinusCircle' | 'emoji';
type Guides = false | 'dotted' | 'solid';
let icon: IconName = 'arrow';
let guides: Guides = 'dotted';
let shape: 'branch' | 'vertical' = 'branch';
// 펼침 아이콘은 세트 이름('folder' 등)으로 고르거나, 열림·닫힘·잎 아이콘을 직접 정할 수 있어요.
const toggleIcon = () =>
icon === 'emoji' ? { expanded: '📂', collapsed: '📁', leaf: '📄' } : icon;
const tree = () => ({
parentKey: 'parentId' as const,
column: 'task',
expandDepth: 'all' as const,
toggleIcon: toggleIcon(),
guides,
guideStyle: shape,
});
export const options: GridOptions<Row> = {
columns: [
{ id: 'task', title: '작업', width: 220 },
{ id: 'owner', title: '담당자', width: 100 },
{ id: 'start', title: '시작', width: 110 },
{ id: 'end', title: '종료', width: 110 },
],
rows,
rowKey: 'id',
tree: tree(),
};
export const actions = {
icon: (api: GridApi<Row>, value?: string) => {
icon = (value ?? 'arrow') as IconName;
api.setOptions({ tree: tree() });
},
guides: (api: GridApi<Row>, value?: string) => {
guides = value === 'off' ? false : value === 'solid' ? 'solid' : 'dotted';
api.setOptions({ tree: tree() });
},
shape: (api: GridApi<Row>, value?: string) => {
shape = value === 'vertical' ? 'vertical' : 'branch';
api.setOptions({ tree: tree() });
},
};버튼을 누르면 이 예제의 코드가 StackBlitz나 CodeSandbox로 전송돼요. 누르기 전에는 아무것도 보내지 않아요.
import { Component } from '@angular/core';
import { GridComponent, isGridEvent, type GridApi, type GridEventMessage } from '@maxgrid/angular';
import { actions, options, type Row } from './example';
@Component({
selector: 'app-example-grid',
standalone: true,
imports: [GridComponent],
template: `
<div class="toolbar">
<select
aria-label="펼침 아이콘"
[disabled]="!api"
(change)="api && actions.icon(api, $any($event.target).value)"
>
<option value="arrow" selected>화살표</option>
<option value="folder">폴더</option>
<option value="plusMinus">+ / -</option>
<option value="plusMinusCircle">원 안의 + / -</option>
<option value="emoji">직접 정한 아이콘</option>
</select>
<select
aria-label="안내선"
[disabled]="!api"
(change)="api && actions.guides(api, $any($event.target).value)"
>
<option value="dotted" selected>점선</option>
<option value="solid">실선</option>
<option value="off">없음</option>
</select>
<select
aria-label="안내선 모양"
[disabled]="!api"
(change)="api && actions.shape(api, $any($event.target).value)"
>
<option value="branch" selected>가지선</option>
<option value="vertical">세로선만</option>
</select>
</div>
<mx-grid style="height: 430px" [options]="options" [events]="relayed" (gridEvent)="onEvent($event)" />
`,
})
export class ExampleGridComponent {
readonly options = options;
readonly actions = actions;
readonly relayed = ['ready'] as const;
api: GridApi<Row> | null = null;
onEvent(event: GridEventMessage<Row>): void {
if (isGridEvent(event, 'ready')) {
this.api = event.payload.api;
}
}
}import type { GridApi, GridOptions } from '@maxgrid/angular';
export interface Row {
id: string;
parentId: string | null;
task: string;
owner: string;
start: string;
end: string;
}
const rows: Row[] = [
{
id: 'T1',
parentId: null,
task: '출시 준비',
owner: '김서연',
start: '2026-11-02',
end: '2026-12-18',
},
{
id: 'T10',
parentId: 'T1',
task: '기획',
owner: '이준호',
start: '2026-11-02',
end: '2026-11-13',
},
{
id: 'T11',
parentId: 'T10',
task: '요구사항 정리',
owner: '이준호',
start: '2026-11-02',
end: '2026-11-06',
},
{
id: 'T12',
parentId: 'T10',
task: '화면 설계',
owner: '박민지',
start: '2026-11-09',
end: '2026-11-13',
},
{
id: 'T20',
parentId: 'T1',
task: '개발',
owner: '최도윤',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T21',
parentId: 'T20',
task: '프런트엔드',
owner: '정하은',
start: '2026-11-16',
end: '2026-11-27',
},
{
id: 'T22',
parentId: 'T20',
task: '백엔드',
owner: '최도윤',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T30',
parentId: 'T1',
task: '테스트',
owner: '박민지',
start: '2026-12-07',
end: '2026-12-18',
},
{
id: 'T31',
parentId: 'T30',
task: '기능 테스트',
owner: '박민지',
start: '2026-12-07',
end: '2026-12-11',
},
{
id: 'T32',
parentId: 'T30',
task: '성능 테스트',
owner: '임태민',
start: '2026-12-14',
end: '2026-12-18',
},
{
id: 'T2',
parentId: null,
task: '운영 준비',
owner: '김서연',
start: '2026-12-07',
end: '2026-12-23',
},
{
id: 'T40',
parentId: 'T2',
task: '교육 자료 작성',
owner: '한지우',
start: '2026-12-07',
end: '2026-12-11',
},
];
type IconName = 'arrow' | 'folder' | 'plusMinus' | 'plusMinusCircle' | 'emoji';
type Guides = false | 'dotted' | 'solid';
let icon: IconName = 'arrow';
let guides: Guides = 'dotted';
let shape: 'branch' | 'vertical' = 'branch';
// 펼침 아이콘은 세트 이름('folder' 등)으로 고르거나, 열림·닫힘·잎 아이콘을 직접 정할 수 있어요.
const toggleIcon = () =>
icon === 'emoji' ? { expanded: '📂', collapsed: '📁', leaf: '📄' } : icon;
const tree = () => ({
parentKey: 'parentId' as const,
column: 'task',
expandDepth: 'all' as const,
toggleIcon: toggleIcon(),
guides,
guideStyle: shape,
});
export const options: GridOptions<Row> = {
columns: [
{ id: 'task', title: '작업', width: 220 },
{ id: 'owner', title: '담당자', width: 100 },
{ id: 'start', title: '시작', width: 110 },
{ id: 'end', title: '종료', width: 110 },
],
rows,
rowKey: 'id',
tree: tree(),
};
export const actions = {
icon: (api: GridApi<Row>, value?: string) => {
icon = (value ?? 'arrow') as IconName;
api.setOptions({ tree: tree() });
},
guides: (api: GridApi<Row>, value?: string) => {
guides = value === 'off' ? false : value === 'solid' ? 'solid' : 'dotted';
api.setOptions({ tree: tree() });
},
shape: (api: GridApi<Row>, value?: string) => {
shape = value === 'vertical' ? 'vertical' : 'branch';
api.setOptions({ tree: tree() });
},
};When you click, the example code is sent to StackBlitz or CodeSandbox. Nothing is sent before you click.
<div id="app">
<div class="toolbar">
<select aria-label="Expand icon" id="icon">
<option value="arrow" selected>Arrow</option>
<option value="folder">Folder</option>
<option value="plusMinus">Plus / minus</option>
<option value="plusMinusCircle">Circled plus / minus</option>
<option value="emoji">Custom icons</option>
</select>
<select aria-label="Guide lines" id="guides">
<option value="dotted" selected>Dotted</option>
<option value="solid">Solid</option>
<option value="off">None</option>
</select>
<select aria-label="Guide shape" id="shape">
<option value="branch" selected>Branch</option>
<option value="vertical">Vertical only</option>
</select>
</div>
<div id="grid" style="height: 430px"></div>
</div>
<script type="module" src="./main.js"></script>import { createGrid } from 'maxgrid';
import { actions, options } from './example';
const api = createGrid(document.getElementById('grid'), options);
document.getElementById('icon').addEventListener('change', (event) => actions.icon(api, event.target.value));
document.getElementById('guides').addEventListener('change', (event) => actions.guides(api, event.target.value));
document.getElementById('shape').addEventListener('change', (event) => actions.shape(api, event.target.value));const rows = [
{
id: 'T1',
parentId: null,
task: 'Release',
owner: 'Emma Stone',
start: '2026-11-02',
end: '2026-12-18',
},
{
id: 'T10',
parentId: 'T1',
task: 'Planning',
owner: 'Liam Carter',
start: '2026-11-02',
end: '2026-11-13',
},
{
id: 'T11',
parentId: 'T10',
task: 'Gather requirements',
owner: 'Liam Carter',
start: '2026-11-02',
end: '2026-11-06',
},
{
id: 'T12',
parentId: 'T10',
task: 'Screen design',
owner: 'Mia Parker',
start: '2026-11-09',
end: '2026-11-13',
},
{
id: 'T20',
parentId: 'T1',
task: 'Development',
owner: 'Noah Davis',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T21',
parentId: 'T20',
task: 'Frontend',
owner: 'Ava Moore',
start: '2026-11-16',
end: '2026-11-27',
},
{
id: 'T22',
parentId: 'T20',
task: 'Backend',
owner: 'Noah Davis',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T30',
parentId: 'T1',
task: 'Testing',
owner: 'Mia Parker',
start: '2026-12-07',
end: '2026-12-18',
},
{
id: 'T31',
parentId: 'T30',
task: 'Functional test',
owner: 'Mia Parker',
start: '2026-12-07',
end: '2026-12-11',
},
{
id: 'T32',
parentId: 'T30',
task: 'Performance test',
owner: 'Ethan Lee',
start: '2026-12-14',
end: '2026-12-18',
},
{
id: 'T2',
parentId: null,
task: 'Operations prep',
owner: 'Emma Stone',
start: '2026-12-07',
end: '2026-12-23',
},
{
id: 'T40',
parentId: 'T2',
task: 'Write training materials',
owner: 'Grace Hall',
start: '2026-12-07',
end: '2026-12-11',
},
];
let icon = 'arrow';
let guides = 'dotted';
let shape = 'branch';
// Pick the expand icon by set name ('folder' and so on), or define the open, closed and leaf icons yourself.
const toggleIcon = () => icon === 'emoji' ? { expanded: '📂', collapsed: '📁', leaf: '📄' } : icon;
const tree = () => ({
parentKey: 'parentId',
column: 'task',
expandDepth: 'all',
toggleIcon: toggleIcon(),
guides,
guideStyle: shape,
});
export const options = {
columns: [
{ id: 'task', title: 'Task', width: 220 },
{ id: 'owner', title: 'Owner', width: 120 },
{ id: 'start', title: 'Start', width: 110 },
{ id: 'end', title: 'End', width: 110 },
],
rows,
rowKey: 'id',
tree: tree(),
};
export const actions = {
icon: (api, value) => {
icon = (value ?? 'arrow');
api.setOptions({ tree: tree() });
},
guides: (api, value) => {
guides = value === 'off' ? false : value === 'solid' ? 'solid' : 'dotted';
api.setOptions({ tree: tree() });
},
shape: (api, value) => {
shape = value === 'vertical' ? 'vertical' : 'branch';
api.setOptions({ tree: tree() });
},
};<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Change the expand icons and guide lines</title>
</head>
<body>
<div class="toolbar">
<select aria-label="Expand icon" id="icon">
<option value="arrow" selected>Arrow</option>
<option value="folder">Folder</option>
<option value="plusMinus">Plus / minus</option>
<option value="plusMinusCircle">Circled plus / minus</option>
<option value="emoji">Custom icons</option>
</select>
<select aria-label="Guide lines" id="guides">
<option value="dotted" selected>Dotted</option>
<option value="solid">Solid</option>
<option value="off">None</option>
</select>
<select aria-label="Guide shape" id="shape">
<option value="branch" selected>Branch</option>
<option value="vertical">Vertical only</option>
</select>
</div>
<div id="grid" style="height: 430px"></div>
<script src="https://cdn.maxmine.com/maxgrid/latest/maxgrid.min.js"></script>
<script>
const rows = [
{
id: 'T1',
parentId: null,
task: 'Release',
owner: 'Emma Stone',
start: '2026-11-02',
end: '2026-12-18',
},
{
id: 'T10',
parentId: 'T1',
task: 'Planning',
owner: 'Liam Carter',
start: '2026-11-02',
end: '2026-11-13',
},
{
id: 'T11',
parentId: 'T10',
task: 'Gather requirements',
owner: 'Liam Carter',
start: '2026-11-02',
end: '2026-11-06',
},
{
id: 'T12',
parentId: 'T10',
task: 'Screen design',
owner: 'Mia Parker',
start: '2026-11-09',
end: '2026-11-13',
},
{
id: 'T20',
parentId: 'T1',
task: 'Development',
owner: 'Noah Davis',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T21',
parentId: 'T20',
task: 'Frontend',
owner: 'Ava Moore',
start: '2026-11-16',
end: '2026-11-27',
},
{
id: 'T22',
parentId: 'T20',
task: 'Backend',
owner: 'Noah Davis',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T30',
parentId: 'T1',
task: 'Testing',
owner: 'Mia Parker',
start: '2026-12-07',
end: '2026-12-18',
},
{
id: 'T31',
parentId: 'T30',
task: 'Functional test',
owner: 'Mia Parker',
start: '2026-12-07',
end: '2026-12-11',
},
{
id: 'T32',
parentId: 'T30',
task: 'Performance test',
owner: 'Ethan Lee',
start: '2026-12-14',
end: '2026-12-18',
},
{
id: 'T2',
parentId: null,
task: 'Operations prep',
owner: 'Emma Stone',
start: '2026-12-07',
end: '2026-12-23',
},
{
id: 'T40',
parentId: 'T2',
task: 'Write training materials',
owner: 'Grace Hall',
start: '2026-12-07',
end: '2026-12-11',
},
];
let icon = 'arrow';
let guides = 'dotted';
let shape = 'branch';
// Pick the expand icon by set name ('folder' and so on), or define the open, closed and leaf icons yourself.
const toggleIcon = () => icon === 'emoji' ? { expanded: '📂', collapsed: '📁', leaf: '📄' } : icon;
const tree = () => ({
parentKey: 'parentId',
column: 'task',
expandDepth: 'all',
toggleIcon: toggleIcon(),
guides,
guideStyle: shape,
});
const options = {
columns: [
{ id: 'task', title: 'Task', width: 220 },
{ id: 'owner', title: 'Owner', width: 120 },
{ id: 'start', title: 'Start', width: 110 },
{ id: 'end', title: 'End', width: 110 },
],
rows,
rowKey: 'id',
tree: tree(),
};
const actions = {
icon: (api, value) => {
icon = (value ?? 'arrow');
api.setOptions({ tree: tree() });
},
guides: (api, value) => {
guides = value === 'off' ? false : value === 'solid' ? 'solid' : 'dotted';
api.setOptions({ tree: tree() });
},
shape: (api, value) => {
shape = value === 'vertical' ? 'vertical' : 'branch';
api.setOptions({ tree: tree() });
},
};
options.ariaLabel = "Change the expand icons and guide lines";
const api = MaxGrid.createGrid(document.getElementById('grid'), options);
document.getElementById('icon').addEventListener('change', (event) => actions.icon(api, event.target.value));
document.getElementById('guides').addEventListener('change', (event) => actions.guides(api, event.target.value));
document.getElementById('shape').addEventListener('change', (event) => actions.shape(api, event.target.value));
</script>
</body>
</html>When you click, the example code is sent to StackBlitz or CodeSandbox. Nothing is sent before you click.
import { Grid, useGridApi } from '@maxgrid/react';
import { actions, options, type Row } from './example';
export function ExampleGrid() {
const [api, gridRef] = useGridApi<Row>();
return (
<>
<div className="toolbar">
<select
aria-label="Expand icon"
disabled={!api}
onChange={(event) => api && actions.icon(api, event.target.value)}
>
<option value="arrow">Arrow</option>
<option value="folder">Folder</option>
<option value="plusMinus">Plus / minus</option>
<option value="plusMinusCircle">Circled plus / minus</option>
<option value="emoji">Custom icons</option>
</select>
<select defaultValue="arrow"
aria-label="Guide lines"
disabled={!api}
onChange={(event) => api && actions.guides(api, event.target.value)}
>
<option value="dotted">Dotted</option>
<option value="solid">Solid</option>
<option value="off">None</option>
</select>
<select defaultValue="dotted"
aria-label="Guide shape"
disabled={!api}
onChange={(event) => api && actions.shape(api, event.target.value)}
>
<option value="branch">Branch</option>
<option value="vertical">Vertical only</option>
</select>
</div>
<Grid style={{ height: 430 }} ref={gridRef} options={options} />
</>
);
}import type { GridApi, GridOptions } from '@maxgrid/react';
export interface Row {
id: string;
parentId: string | null;
task: string;
owner: string;
start: string;
end: string;
}
const rows: Row[] = [
{
id: 'T1',
parentId: null,
task: 'Release',
owner: 'Emma Stone',
start: '2026-11-02',
end: '2026-12-18',
},
{
id: 'T10',
parentId: 'T1',
task: 'Planning',
owner: 'Liam Carter',
start: '2026-11-02',
end: '2026-11-13',
},
{
id: 'T11',
parentId: 'T10',
task: 'Gather requirements',
owner: 'Liam Carter',
start: '2026-11-02',
end: '2026-11-06',
},
{
id: 'T12',
parentId: 'T10',
task: 'Screen design',
owner: 'Mia Parker',
start: '2026-11-09',
end: '2026-11-13',
},
{
id: 'T20',
parentId: 'T1',
task: 'Development',
owner: 'Noah Davis',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T21',
parentId: 'T20',
task: 'Frontend',
owner: 'Ava Moore',
start: '2026-11-16',
end: '2026-11-27',
},
{
id: 'T22',
parentId: 'T20',
task: 'Backend',
owner: 'Noah Davis',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T30',
parentId: 'T1',
task: 'Testing',
owner: 'Mia Parker',
start: '2026-12-07',
end: '2026-12-18',
},
{
id: 'T31',
parentId: 'T30',
task: 'Functional test',
owner: 'Mia Parker',
start: '2026-12-07',
end: '2026-12-11',
},
{
id: 'T32',
parentId: 'T30',
task: 'Performance test',
owner: 'Ethan Lee',
start: '2026-12-14',
end: '2026-12-18',
},
{
id: 'T2',
parentId: null,
task: 'Operations prep',
owner: 'Emma Stone',
start: '2026-12-07',
end: '2026-12-23',
},
{
id: 'T40',
parentId: 'T2',
task: 'Write training materials',
owner: 'Grace Hall',
start: '2026-12-07',
end: '2026-12-11',
},
];
type IconName = 'arrow' | 'folder' | 'plusMinus' | 'plusMinusCircle' | 'emoji';
type Guides = false | 'dotted' | 'solid';
let icon: IconName = 'arrow';
let guides: Guides = 'dotted';
let shape: 'branch' | 'vertical' = 'branch';
// Pick the expand icon by set name ('folder' and so on), or define the open, closed and leaf icons yourself.
const toggleIcon = () =>
icon === 'emoji' ? { expanded: '📂', collapsed: '📁', leaf: '📄' } : icon;
const tree = () => ({
parentKey: 'parentId' as const,
column: 'task',
expandDepth: 'all' as const,
toggleIcon: toggleIcon(),
guides,
guideStyle: shape,
});
export const options: GridOptions<Row> = {
columns: [
{ id: 'task', title: 'Task', width: 220 },
{ id: 'owner', title: 'Owner', width: 120 },
{ id: 'start', title: 'Start', width: 110 },
{ id: 'end', title: 'End', width: 110 },
],
rows,
rowKey: 'id',
tree: tree(),
};
export const actions = {
icon: (api: GridApi<Row>, value?: string) => {
icon = (value ?? 'arrow') as IconName;
api.setOptions({ tree: tree() });
},
guides: (api: GridApi<Row>, value?: string) => {
guides = value === 'off' ? false : value === 'solid' ? 'solid' : 'dotted';
api.setOptions({ tree: tree() });
},
shape: (api: GridApi<Row>, value?: string) => {
shape = value === 'vertical' ? 'vertical' : 'branch';
api.setOptions({ tree: tree() });
},
};When you click, the example code is sent to StackBlitz or CodeSandbox. Nothing is sent before you click.
<script setup lang="ts">
import { shallowRef } from 'vue';
import { Grid, type GridApi } from '@maxgrid/vue';
import { actions, options, type Row } from './example';
const api = shallowRef<GridApi<Row> | null>(null);
function onReady(event: { api: GridApi<Row> }) {
api.value = event.api;
}
</script>
<template>
<div class="toolbar">
<select
aria-label="Expand icon"
:disabled="!api"
@change="api && actions.icon(api, ($event.target as HTMLSelectElement).value)"
>
<option value="arrow" selected>Arrow</option>
<option value="folder">Folder</option>
<option value="plusMinus">Plus / minus</option>
<option value="plusMinusCircle">Circled plus / minus</option>
<option value="emoji">Custom icons</option>
</select>
<select
aria-label="Guide lines"
:disabled="!api"
@change="api && actions.guides(api, ($event.target as HTMLSelectElement).value)"
>
<option value="dotted" selected>Dotted</option>
<option value="solid">Solid</option>
<option value="off">None</option>
</select>
<select
aria-label="Guide shape"
:disabled="!api"
@change="api && actions.shape(api, ($event.target as HTMLSelectElement).value)"
>
<option value="branch" selected>Branch</option>
<option value="vertical">Vertical only</option>
</select>
</div>
<Grid style="height: 430px" :options="options" @ready="onReady" />
</template>import type { GridApi, GridOptions } from '@maxgrid/vue';
export interface Row {
id: string;
parentId: string | null;
task: string;
owner: string;
start: string;
end: string;
}
const rows: Row[] = [
{
id: 'T1',
parentId: null,
task: 'Release',
owner: 'Emma Stone',
start: '2026-11-02',
end: '2026-12-18',
},
{
id: 'T10',
parentId: 'T1',
task: 'Planning',
owner: 'Liam Carter',
start: '2026-11-02',
end: '2026-11-13',
},
{
id: 'T11',
parentId: 'T10',
task: 'Gather requirements',
owner: 'Liam Carter',
start: '2026-11-02',
end: '2026-11-06',
},
{
id: 'T12',
parentId: 'T10',
task: 'Screen design',
owner: 'Mia Parker',
start: '2026-11-09',
end: '2026-11-13',
},
{
id: 'T20',
parentId: 'T1',
task: 'Development',
owner: 'Noah Davis',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T21',
parentId: 'T20',
task: 'Frontend',
owner: 'Ava Moore',
start: '2026-11-16',
end: '2026-11-27',
},
{
id: 'T22',
parentId: 'T20',
task: 'Backend',
owner: 'Noah Davis',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T30',
parentId: 'T1',
task: 'Testing',
owner: 'Mia Parker',
start: '2026-12-07',
end: '2026-12-18',
},
{
id: 'T31',
parentId: 'T30',
task: 'Functional test',
owner: 'Mia Parker',
start: '2026-12-07',
end: '2026-12-11',
},
{
id: 'T32',
parentId: 'T30',
task: 'Performance test',
owner: 'Ethan Lee',
start: '2026-12-14',
end: '2026-12-18',
},
{
id: 'T2',
parentId: null,
task: 'Operations prep',
owner: 'Emma Stone',
start: '2026-12-07',
end: '2026-12-23',
},
{
id: 'T40',
parentId: 'T2',
task: 'Write training materials',
owner: 'Grace Hall',
start: '2026-12-07',
end: '2026-12-11',
},
];
type IconName = 'arrow' | 'folder' | 'plusMinus' | 'plusMinusCircle' | 'emoji';
type Guides = false | 'dotted' | 'solid';
let icon: IconName = 'arrow';
let guides: Guides = 'dotted';
let shape: 'branch' | 'vertical' = 'branch';
// Pick the expand icon by set name ('folder' and so on), or define the open, closed and leaf icons yourself.
const toggleIcon = () =>
icon === 'emoji' ? { expanded: '📂', collapsed: '📁', leaf: '📄' } : icon;
const tree = () => ({
parentKey: 'parentId' as const,
column: 'task',
expandDepth: 'all' as const,
toggleIcon: toggleIcon(),
guides,
guideStyle: shape,
});
export const options: GridOptions<Row> = {
columns: [
{ id: 'task', title: 'Task', width: 220 },
{ id: 'owner', title: 'Owner', width: 120 },
{ id: 'start', title: 'Start', width: 110 },
{ id: 'end', title: 'End', width: 110 },
],
rows,
rowKey: 'id',
tree: tree(),
};
export const actions = {
icon: (api: GridApi<Row>, value?: string) => {
icon = (value ?? 'arrow') as IconName;
api.setOptions({ tree: tree() });
},
guides: (api: GridApi<Row>, value?: string) => {
guides = value === 'off' ? false : value === 'solid' ? 'solid' : 'dotted';
api.setOptions({ tree: tree() });
},
shape: (api: GridApi<Row>, value?: string) => {
shape = value === 'vertical' ? 'vertical' : 'branch';
api.setOptions({ tree: tree() });
},
};When you click, the example code is sent to StackBlitz or CodeSandbox. Nothing is sent before you click.
import { Component } from '@angular/core';
import { GridComponent, isGridEvent, type GridApi, type GridEventMessage } from '@maxgrid/angular';
import { actions, options, type Row } from './example';
@Component({
selector: 'app-example-grid',
standalone: true,
imports: [GridComponent],
template: `
<div class="toolbar">
<select
aria-label="Expand icon"
[disabled]="!api"
(change)="api && actions.icon(api, $any($event.target).value)"
>
<option value="arrow" selected>Arrow</option>
<option value="folder">Folder</option>
<option value="plusMinus">Plus / minus</option>
<option value="plusMinusCircle">Circled plus / minus</option>
<option value="emoji">Custom icons</option>
</select>
<select
aria-label="Guide lines"
[disabled]="!api"
(change)="api && actions.guides(api, $any($event.target).value)"
>
<option value="dotted" selected>Dotted</option>
<option value="solid">Solid</option>
<option value="off">None</option>
</select>
<select
aria-label="Guide shape"
[disabled]="!api"
(change)="api && actions.shape(api, $any($event.target).value)"
>
<option value="branch" selected>Branch</option>
<option value="vertical">Vertical only</option>
</select>
</div>
<mx-grid style="height: 430px" [options]="options" [events]="relayed" (gridEvent)="onEvent($event)" />
`,
})
export class ExampleGridComponent {
readonly options = options;
readonly actions = actions;
readonly relayed = ['ready'] as const;
api: GridApi<Row> | null = null;
onEvent(event: GridEventMessage<Row>): void {
if (isGridEvent(event, 'ready')) {
this.api = event.payload.api;
}
}
}import type { GridApi, GridOptions } from '@maxgrid/angular';
export interface Row {
id: string;
parentId: string | null;
task: string;
owner: string;
start: string;
end: string;
}
const rows: Row[] = [
{
id: 'T1',
parentId: null,
task: 'Release',
owner: 'Emma Stone',
start: '2026-11-02',
end: '2026-12-18',
},
{
id: 'T10',
parentId: 'T1',
task: 'Planning',
owner: 'Liam Carter',
start: '2026-11-02',
end: '2026-11-13',
},
{
id: 'T11',
parentId: 'T10',
task: 'Gather requirements',
owner: 'Liam Carter',
start: '2026-11-02',
end: '2026-11-06',
},
{
id: 'T12',
parentId: 'T10',
task: 'Screen design',
owner: 'Mia Parker',
start: '2026-11-09',
end: '2026-11-13',
},
{
id: 'T20',
parentId: 'T1',
task: 'Development',
owner: 'Noah Davis',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T21',
parentId: 'T20',
task: 'Frontend',
owner: 'Ava Moore',
start: '2026-11-16',
end: '2026-11-27',
},
{
id: 'T22',
parentId: 'T20',
task: 'Backend',
owner: 'Noah Davis',
start: '2026-11-16',
end: '2026-12-04',
},
{
id: 'T30',
parentId: 'T1',
task: 'Testing',
owner: 'Mia Parker',
start: '2026-12-07',
end: '2026-12-18',
},
{
id: 'T31',
parentId: 'T30',
task: 'Functional test',
owner: 'Mia Parker',
start: '2026-12-07',
end: '2026-12-11',
},
{
id: 'T32',
parentId: 'T30',
task: 'Performance test',
owner: 'Ethan Lee',
start: '2026-12-14',
end: '2026-12-18',
},
{
id: 'T2',
parentId: null,
task: 'Operations prep',
owner: 'Emma Stone',
start: '2026-12-07',
end: '2026-12-23',
},
{
id: 'T40',
parentId: 'T2',
task: 'Write training materials',
owner: 'Grace Hall',
start: '2026-12-07',
end: '2026-12-11',
},
];
type IconName = 'arrow' | 'folder' | 'plusMinus' | 'plusMinusCircle' | 'emoji';
type Guides = false | 'dotted' | 'solid';
let icon: IconName = 'arrow';
let guides: Guides = 'dotted';
let shape: 'branch' | 'vertical' = 'branch';
// Pick the expand icon by set name ('folder' and so on), or define the open, closed and leaf icons yourself.
const toggleIcon = () =>
icon === 'emoji' ? { expanded: '📂', collapsed: '📁', leaf: '📄' } : icon;
const tree = () => ({
parentKey: 'parentId' as const,
column: 'task',
expandDepth: 'all' as const,
toggleIcon: toggleIcon(),
guides,
guideStyle: shape,
});
export const options: GridOptions<Row> = {
columns: [
{ id: 'task', title: 'Task', width: 220 },
{ id: 'owner', title: 'Owner', width: 120 },
{ id: 'start', title: 'Start', width: 110 },
{ id: 'end', title: 'End', width: 110 },
],
rows,
rowKey: 'id',
tree: tree(),
};
export const actions = {
icon: (api: GridApi<Row>, value?: string) => {
icon = (value ?? 'arrow') as IconName;
api.setOptions({ tree: tree() });
},
guides: (api: GridApi<Row>, value?: string) => {
guides = value === 'off' ? false : value === 'solid' ? 'solid' : 'dotted';
api.setOptions({ tree: tree() });
},
shape: (api: GridApi<Row>, value?: string) => {
shape = value === 'vertical' ? 'vertical' : 'branch';
api.setOptions({ tree: tree() });
},
};