둥근 아이콘 스타일The soft icon style
iconStyle: 'soft'는 정렬 화살표, 트리 화살표, 체크, 닫기 ×, 끌기 손잡이, 별점을 둥근 끝의 선 아이콘으로 바꿔요. 기본은 'default'이고 icons 옵션으로 정한 아이콘은 늘 그대로예요.iconStyle: 'soft' swaps the sort arrows, tree arrows, check marks, close ×, drag grip and rating stars for round-ended line icons. The default is 'default', and icons you set with the icons option always stay as they are.
코드Code
탭을 골라 코드를 복사하세요. 위 화면은 이 코드를 그대로 실행한 결과예요.Pick a tab and copy the code. The preview above runs exactly this code.
버튼을 누르면 이 예제의 코드가 StackBlitz나 CodeSandbox로 전송돼요. 누르기 전에는 아무것도 보내지 않아요.
<div id="app">
<div class="toolbar">
<select aria-label="아이콘 스타일" id="iconStyle">
<option value="default">기본</option>
<option value="soft" selected>둥글게</option>
</select>
</div>
<div id="grid" style="height: 230px"></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('iconStyle').addEventListener('change', (event) => actions.iconStyle(api, event.target.value));const en = document.documentElement.dataset.lang === 'en';
const rows = [
{
id: 1,
parentId: null,
name: en ? 'Launch' : '출시',
team: en ? 'Dev' : '개발',
done: false,
score: 4,
},
{
id: 2,
parentId: 1,
name: en ? 'Design' : '디자인',
team: en ? 'Design' : '디자인',
done: true,
score: 5,
},
{
id: 3,
parentId: 1,
name: en ? 'Build' : '구현',
team: en ? 'Dev' : '개발',
done: false,
score: 3,
},
{
id: 4,
parentId: null,
name: en ? 'Support' : '지원',
team: en ? 'Ops' : '운영',
done: true,
score: 2,
},
{
id: 5,
parentId: 4,
name: en ? 'Docs' : '문서',
team: en ? 'Ops' : '운영',
done: true,
score: 4,
},
];
export const options = {
columns: [
{ id: 'name', title: en ? 'Task' : '작업', width: 170, sortable: true },
{ id: 'team', title: en ? 'Team' : '팀', width: 110, sortable: true },
{ id: 'done', title: en ? 'Done' : '완료', width: 80, cellRenderer: 'checkbox' },
{ id: 'score', title: en ? 'Score' : '점수', width: 130, cellRenderer: 'rating' },
],
rows,
rowKey: 'id',
tree: { parentKey: 'parentId', expandDepth: 'all' },
// iconStyle: 'soft'면 정렬 화살표·펼침 화살표·체크·별이 모두 둥근 선 아이콘이 돼요. 기본은 'default'예요.
iconStyle: 'soft',
};
export const actions = {
iconStyle: (api, value) => {
if (value === 'default' || value === 'soft')
api.setOptions({ iconStyle: value });
},
};<!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="iconStyle">
<option value="default">기본</option>
<option value="soft" selected>둥글게</option>
</select>
</div>
<div id="grid" style="height: 230px"></div>
<script src="https://cdn.maxmine.com/maxgrid/latest/maxgrid.min.js"></script>
<script>
const en = document.documentElement.dataset.lang === 'en';
const rows = [
{
id: 1,
parentId: null,
name: en ? 'Launch' : '출시',
team: en ? 'Dev' : '개발',
done: false,
score: 4,
},
{
id: 2,
parentId: 1,
name: en ? 'Design' : '디자인',
team: en ? 'Design' : '디자인',
done: true,
score: 5,
},
{
id: 3,
parentId: 1,
name: en ? 'Build' : '구현',
team: en ? 'Dev' : '개발',
done: false,
score: 3,
},
{
id: 4,
parentId: null,
name: en ? 'Support' : '지원',
team: en ? 'Ops' : '운영',
done: true,
score: 2,
},
{
id: 5,
parentId: 4,
name: en ? 'Docs' : '문서',
team: en ? 'Ops' : '운영',
done: true,
score: 4,
},
];
const options = {
columns: [
{ id: 'name', title: en ? 'Task' : '작업', width: 170, sortable: true },
{ id: 'team', title: en ? 'Team' : '팀', width: 110, sortable: true },
{ id: 'done', title: en ? 'Done' : '완료', width: 80, cellRenderer: 'checkbox' },
{ id: 'score', title: en ? 'Score' : '점수', width: 130, cellRenderer: 'rating' },
],
rows,
rowKey: 'id',
tree: { parentKey: 'parentId', expandDepth: 'all' },
// iconStyle: 'soft'면 정렬 화살표·펼침 화살표·체크·별이 모두 둥근 선 아이콘이 돼요. 기본은 'default'예요.
iconStyle: 'soft',
};
const actions = {
iconStyle: (api, value) => {
if (value === 'default' || value === 'soft')
api.setOptions({ iconStyle: value });
},
};
options.ariaLabel = "둥근 아이콘 스타일";
const api = MaxGrid.createGrid(document.getElementById('grid'), options);
document.getElementById('iconStyle').addEventListener('change', (event) => actions.iconStyle(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.iconStyle(api, event.target.value)}
>
<option value="default">기본</option>
<option value="soft">둥글게</option>
</select>
</div>
<Grid style={{ height: 230 }} ref={gridRef} options={options} />
</>
);
}import type { GridApi, GridOptions } from '@maxgrid/react';
const en = document.documentElement.dataset.lang === 'en';
export interface Row {
id: number;
parentId: number | null;
name: string;
team: string;
done: boolean;
score: number;
}
const rows: Row[] = [
{
id: 1,
parentId: null,
name: en ? 'Launch' : '출시',
team: en ? 'Dev' : '개발',
done: false,
score: 4,
},
{
id: 2,
parentId: 1,
name: en ? 'Design' : '디자인',
team: en ? 'Design' : '디자인',
done: true,
score: 5,
},
{
id: 3,
parentId: 1,
name: en ? 'Build' : '구현',
team: en ? 'Dev' : '개발',
done: false,
score: 3,
},
{
id: 4,
parentId: null,
name: en ? 'Support' : '지원',
team: en ? 'Ops' : '운영',
done: true,
score: 2,
},
{
id: 5,
parentId: 4,
name: en ? 'Docs' : '문서',
team: en ? 'Ops' : '운영',
done: true,
score: 4,
},
];
export const options: GridOptions<Row> = {
columns: [
{ id: 'name', title: en ? 'Task' : '작업', width: 170, sortable: true },
{ id: 'team', title: en ? 'Team' : '팀', width: 110, sortable: true },
{ id: 'done', title: en ? 'Done' : '완료', width: 80, cellRenderer: 'checkbox' },
{ id: 'score', title: en ? 'Score' : '점수', width: 130, cellRenderer: 'rating' },
],
rows,
rowKey: 'id',
tree: { parentKey: 'parentId', expandDepth: 'all' },
// iconStyle: 'soft'면 정렬 화살표·펼침 화살표·체크·별이 모두 둥근 선 아이콘이 돼요. 기본은 'default'예요.
iconStyle: 'soft',
};
export const actions = {
iconStyle: (api: GridApi<Row>, value?: string) => {
if (value === 'default' || value === 'soft') api.setOptions({ iconStyle: value });
},
};버튼을 누르면 이 예제의 코드가 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.iconStyle(api, ($event.target as HTMLSelectElement).value)"
>
<option value="default">기본</option>
<option value="soft" selected>둥글게</option>
</select>
</div>
<Grid style="height: 230px" :options="options" @ready="onReady" />
</template>import type { GridApi, GridOptions } from '@maxgrid/vue';
const en = document.documentElement.dataset.lang === 'en';
export interface Row {
id: number;
parentId: number | null;
name: string;
team: string;
done: boolean;
score: number;
}
const rows: Row[] = [
{
id: 1,
parentId: null,
name: en ? 'Launch' : '출시',
team: en ? 'Dev' : '개발',
done: false,
score: 4,
},
{
id: 2,
parentId: 1,
name: en ? 'Design' : '디자인',
team: en ? 'Design' : '디자인',
done: true,
score: 5,
},
{
id: 3,
parentId: 1,
name: en ? 'Build' : '구현',
team: en ? 'Dev' : '개발',
done: false,
score: 3,
},
{
id: 4,
parentId: null,
name: en ? 'Support' : '지원',
team: en ? 'Ops' : '운영',
done: true,
score: 2,
},
{
id: 5,
parentId: 4,
name: en ? 'Docs' : '문서',
team: en ? 'Ops' : '운영',
done: true,
score: 4,
},
];
export const options: GridOptions<Row> = {
columns: [
{ id: 'name', title: en ? 'Task' : '작업', width: 170, sortable: true },
{ id: 'team', title: en ? 'Team' : '팀', width: 110, sortable: true },
{ id: 'done', title: en ? 'Done' : '완료', width: 80, cellRenderer: 'checkbox' },
{ id: 'score', title: en ? 'Score' : '점수', width: 130, cellRenderer: 'rating' },
],
rows,
rowKey: 'id',
tree: { parentKey: 'parentId', expandDepth: 'all' },
// iconStyle: 'soft'면 정렬 화살표·펼침 화살표·체크·별이 모두 둥근 선 아이콘이 돼요. 기본은 'default'예요.
iconStyle: 'soft',
};
export const actions = {
iconStyle: (api: GridApi<Row>, value?: string) => {
if (value === 'default' || value === 'soft') api.setOptions({ iconStyle: value });
},
};버튼을 누르면 이 예제의 코드가 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.iconStyle(api, $any($event.target).value)"
>
<option value="default">기본</option>
<option value="soft" selected>둥글게</option>
</select>
</div>
<mx-grid style="height: 230px" [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';
const en = document.documentElement.dataset.lang === 'en';
export interface Row {
id: number;
parentId: number | null;
name: string;
team: string;
done: boolean;
score: number;
}
const rows: Row[] = [
{
id: 1,
parentId: null,
name: en ? 'Launch' : '출시',
team: en ? 'Dev' : '개발',
done: false,
score: 4,
},
{
id: 2,
parentId: 1,
name: en ? 'Design' : '디자인',
team: en ? 'Design' : '디자인',
done: true,
score: 5,
},
{
id: 3,
parentId: 1,
name: en ? 'Build' : '구현',
team: en ? 'Dev' : '개발',
done: false,
score: 3,
},
{
id: 4,
parentId: null,
name: en ? 'Support' : '지원',
team: en ? 'Ops' : '운영',
done: true,
score: 2,
},
{
id: 5,
parentId: 4,
name: en ? 'Docs' : '문서',
team: en ? 'Ops' : '운영',
done: true,
score: 4,
},
];
export const options: GridOptions<Row> = {
columns: [
{ id: 'name', title: en ? 'Task' : '작업', width: 170, sortable: true },
{ id: 'team', title: en ? 'Team' : '팀', width: 110, sortable: true },
{ id: 'done', title: en ? 'Done' : '완료', width: 80, cellRenderer: 'checkbox' },
{ id: 'score', title: en ? 'Score' : '점수', width: 130, cellRenderer: 'rating' },
],
rows,
rowKey: 'id',
tree: { parentKey: 'parentId', expandDepth: 'all' },
// iconStyle: 'soft'면 정렬 화살표·펼침 화살표·체크·별이 모두 둥근 선 아이콘이 돼요. 기본은 'default'예요.
iconStyle: 'soft',
};
export const actions = {
iconStyle: (api: GridApi<Row>, value?: string) => {
if (value === 'default' || value === 'soft') api.setOptions({ iconStyle: value });
},
};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="Icon style" id="iconStyle">
<option value="default">Default</option>
<option value="soft" selected>Soft</option>
</select>
</div>
<div id="grid" style="height: 230px"></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('iconStyle').addEventListener('change', (event) => actions.iconStyle(api, event.target.value));const rows = [
{ id: 1, parentId: null, name: 'Launch', team: 'Dev', done: false, score: 4 },
{ id: 2, parentId: 1, name: 'Design', team: 'Design', done: true, score: 5 },
{ id: 3, parentId: 1, name: 'Build', team: 'Dev', done: false, score: 3 },
{ id: 4, parentId: null, name: 'Support', team: 'Ops', done: true, score: 2 },
{ id: 5, parentId: 4, name: 'Docs', team: 'Ops', done: true, score: 4 },
];
export const options = {
columns: [
{ id: 'name', title: 'Task', width: 170, sortable: true },
{ id: 'team', title: 'Team', width: 110, sortable: true },
{ id: 'done', title: 'Done', width: 80, cellRenderer: 'checkbox' },
{ id: 'score', title: 'Score', width: 130, cellRenderer: 'rating' },
],
rows,
rowKey: 'id',
tree: { parentKey: 'parentId', expandDepth: 'all' },
// With iconStyle: 'soft', the sort arrows, expand arrows, checks and stars all become rounded line icons. The default is 'default'.
iconStyle: 'soft',
};
export const actions = {
iconStyle: (api, value) => {
if (value === 'default' || value === 'soft')
api.setOptions({ iconStyle: value });
},
};<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>The soft icon style</title>
</head>
<body>
<div class="toolbar">
<select aria-label="Icon style" id="iconStyle">
<option value="default">Default</option>
<option value="soft" selected>Soft</option>
</select>
</div>
<div id="grid" style="height: 230px"></div>
<script src="https://cdn.maxmine.com/maxgrid/latest/maxgrid.min.js"></script>
<script>
const rows = [
{ id: 1, parentId: null, name: 'Launch', team: 'Dev', done: false, score: 4 },
{ id: 2, parentId: 1, name: 'Design', team: 'Design', done: true, score: 5 },
{ id: 3, parentId: 1, name: 'Build', team: 'Dev', done: false, score: 3 },
{ id: 4, parentId: null, name: 'Support', team: 'Ops', done: true, score: 2 },
{ id: 5, parentId: 4, name: 'Docs', team: 'Ops', done: true, score: 4 },
];
const options = {
columns: [
{ id: 'name', title: 'Task', width: 170, sortable: true },
{ id: 'team', title: 'Team', width: 110, sortable: true },
{ id: 'done', title: 'Done', width: 80, cellRenderer: 'checkbox' },
{ id: 'score', title: 'Score', width: 130, cellRenderer: 'rating' },
],
rows,
rowKey: 'id',
tree: { parentKey: 'parentId', expandDepth: 'all' },
// With iconStyle: 'soft', the sort arrows, expand arrows, checks and stars all become rounded line icons. The default is 'default'.
iconStyle: 'soft',
};
const actions = {
iconStyle: (api, value) => {
if (value === 'default' || value === 'soft')
api.setOptions({ iconStyle: value });
},
};
options.ariaLabel = "The soft icon style";
const api = MaxGrid.createGrid(document.getElementById('grid'), options);
document.getElementById('iconStyle').addEventListener('change', (event) => actions.iconStyle(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="Icon style"
disabled={!api}
onChange={(event) => api && actions.iconStyle(api, event.target.value)}
>
<option value="default">Default</option>
<option value="soft">Soft</option>
</select>
</div>
<Grid style={{ height: 230 }} ref={gridRef} options={options} />
</>
);
}import type { GridApi, GridOptions } from '@maxgrid/react';
export interface Row {
id: number;
parentId: number | null;
name: string;
team: string;
done: boolean;
score: number;
}
const rows: Row[] = [
{ id: 1, parentId: null, name: 'Launch', team: 'Dev', done: false, score: 4 },
{ id: 2, parentId: 1, name: 'Design', team: 'Design', done: true, score: 5 },
{ id: 3, parentId: 1, name: 'Build', team: 'Dev', done: false, score: 3 },
{ id: 4, parentId: null, name: 'Support', team: 'Ops', done: true, score: 2 },
{ id: 5, parentId: 4, name: 'Docs', team: 'Ops', done: true, score: 4 },
];
export const options: GridOptions<Row> = {
columns: [
{ id: 'name', title: 'Task', width: 170, sortable: true },
{ id: 'team', title: 'Team', width: 110, sortable: true },
{ id: 'done', title: 'Done', width: 80, cellRenderer: 'checkbox' },
{ id: 'score', title: 'Score', width: 130, cellRenderer: 'rating' },
],
rows,
rowKey: 'id',
tree: { parentKey: 'parentId', expandDepth: 'all' },
// With iconStyle: 'soft', the sort arrows, expand arrows, checks and stars all become rounded line icons. The default is 'default'.
iconStyle: 'soft',
};
export const actions = {
iconStyle: (api: GridApi<Row>, value?: string) => {
if (value === 'default' || value === 'soft') api.setOptions({ iconStyle: value });
},
};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="Icon style"
:disabled="!api"
@change="api && actions.iconStyle(api, ($event.target as HTMLSelectElement).value)"
>
<option value="default">Default</option>
<option value="soft" selected>Soft</option>
</select>
</div>
<Grid style="height: 230px" :options="options" @ready="onReady" />
</template>import type { GridApi, GridOptions } from '@maxgrid/vue';
export interface Row {
id: number;
parentId: number | null;
name: string;
team: string;
done: boolean;
score: number;
}
const rows: Row[] = [
{ id: 1, parentId: null, name: 'Launch', team: 'Dev', done: false, score: 4 },
{ id: 2, parentId: 1, name: 'Design', team: 'Design', done: true, score: 5 },
{ id: 3, parentId: 1, name: 'Build', team: 'Dev', done: false, score: 3 },
{ id: 4, parentId: null, name: 'Support', team: 'Ops', done: true, score: 2 },
{ id: 5, parentId: 4, name: 'Docs', team: 'Ops', done: true, score: 4 },
];
export const options: GridOptions<Row> = {
columns: [
{ id: 'name', title: 'Task', width: 170, sortable: true },
{ id: 'team', title: 'Team', width: 110, sortable: true },
{ id: 'done', title: 'Done', width: 80, cellRenderer: 'checkbox' },
{ id: 'score', title: 'Score', width: 130, cellRenderer: 'rating' },
],
rows,
rowKey: 'id',
tree: { parentKey: 'parentId', expandDepth: 'all' },
// With iconStyle: 'soft', the sort arrows, expand arrows, checks and stars all become rounded line icons. The default is 'default'.
iconStyle: 'soft',
};
export const actions = {
iconStyle: (api: GridApi<Row>, value?: string) => {
if (value === 'default' || value === 'soft') api.setOptions({ iconStyle: value });
},
};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="Icon style"
[disabled]="!api"
(change)="api && actions.iconStyle(api, $any($event.target).value)"
>
<option value="default">Default</option>
<option value="soft" selected>Soft</option>
</select>
</div>
<mx-grid style="height: 230px" [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: number;
parentId: number | null;
name: string;
team: string;
done: boolean;
score: number;
}
const rows: Row[] = [
{ id: 1, parentId: null, name: 'Launch', team: 'Dev', done: false, score: 4 },
{ id: 2, parentId: 1, name: 'Design', team: 'Design', done: true, score: 5 },
{ id: 3, parentId: 1, name: 'Build', team: 'Dev', done: false, score: 3 },
{ id: 4, parentId: null, name: 'Support', team: 'Ops', done: true, score: 2 },
{ id: 5, parentId: 4, name: 'Docs', team: 'Ops', done: true, score: 4 },
];
export const options: GridOptions<Row> = {
columns: [
{ id: 'name', title: 'Task', width: 170, sortable: true },
{ id: 'team', title: 'Team', width: 110, sortable: true },
{ id: 'done', title: 'Done', width: 80, cellRenderer: 'checkbox' },
{ id: 'score', title: 'Score', width: 130, cellRenderer: 'rating' },
],
rows,
rowKey: 'id',
tree: { parentKey: 'parentId', expandDepth: 'all' },
// With iconStyle: 'soft', the sort arrows, expand arrows, checks and stars all become rounded line icons. The default is 'default'.
iconStyle: 'soft',
};
export const actions = {
iconStyle: (api: GridApi<Row>, value?: string) => {
if (value === 'default' || value === 'soft') api.setOptions({ iconStyle: value });
},
};