제목 줄 없이 목록만 보여 주기Show a list without a header row
알림이나 로그처럼 컬럼 제목이 필요 없는 목록은 헤더 줄을 감추면 더 깔끔해요. 필요하면 언제든 다시 보이게 할 수 있어요.For notices or logs that need no column titles, hiding the header row looks cleaner. Bring it back any time.
코드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="header">
<option value="hide" selected>감추기</option>
<option value="show">보이기</option>
</select>
</div>
<div id="grid" style="height: 298px"></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('header').addEventListener('change', (event) => actions.header(api, event.target.value));const places = ['1호기', '2호기', '냉각 설비', '포장 라인', '출하장'];
const messages = ['정상 가동', '온도 점검 필요', '정기 점검 완료', '재고 보충 요청', '출고 대기'];
// 제목 줄이 없어도 뜻이 통하는 표(알림 목록, 로그 등)에는 showHeader: false를 써요.
export const options = {
columns: [
{ id: 'time', title: '시각', width: 90 },
{ id: 'place', title: '장소', width: 120 },
{ id: 'message', title: '내용', width: 220 },
],
rows: Array.from({ length: 8 }, (_, i) => ({
id: i + 1,
time: `09:${String(5 + i * 7).padStart(2, '0')}`,
place: places[i % 5],
message: messages[(i * 2) % 5],
})),
rowKey: 'id',
showHeader: false,
};
export const actions = {
header: (api, value) => {
const show = value === 'show';
// 헤더가 없으면 정렬 상태를 눈으로 확인할 수도, 바꿀 수도 없어요. 숨길 때 정렬을 함께 풀어요.
if (!show)
api.setSortModel([]);
api.setOptions({ showHeader: show });
},
};<!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="header">
<option value="hide" selected>감추기</option>
<option value="show">보이기</option>
</select>
</div>
<div id="grid" style="height: 298px"></div>
<script src="https://cdn.maxmine.com/maxgrid/latest/maxgrid.min.js"></script>
<script>
const places = ['1호기', '2호기', '냉각 설비', '포장 라인', '출하장'];
const messages = ['정상 가동', '온도 점검 필요', '정기 점검 완료', '재고 보충 요청', '출고 대기'];
// 제목 줄이 없어도 뜻이 통하는 표(알림 목록, 로그 등)에는 showHeader: false를 써요.
const options = {
columns: [
{ id: 'time', title: '시각', width: 90 },
{ id: 'place', title: '장소', width: 120 },
{ id: 'message', title: '내용', width: 220 },
],
rows: Array.from({ length: 8 }, (_, i) => ({
id: i + 1,
time: `09:${String(5 + i * 7).padStart(2, '0')}`,
place: places[i % 5],
message: messages[(i * 2) % 5],
})),
rowKey: 'id',
showHeader: false,
};
const actions = {
header: (api, value) => {
const show = value === 'show';
// 헤더가 없으면 정렬 상태를 눈으로 확인할 수도, 바꿀 수도 없어요. 숨길 때 정렬을 함께 풀어요.
if (!show)
api.setSortModel([]);
api.setOptions({ showHeader: show });
},
};
options.ariaLabel = "제목 줄 없이 목록만 보여 주기";
const api = MaxGrid.createGrid(document.getElementById('grid'), options);
document.getElementById('header').addEventListener('change', (event) => actions.header(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.header(api, event.target.value)}
>
<option value="hide">감추기</option>
<option value="show">보이기</option>
</select>
</div>
<Grid style={{ height: 298 }} ref={gridRef} options={options} />
</>
);
}import type { GridApi, GridOptions } from '@maxgrid/react';
export interface Row {
id: number;
time: string;
place: string;
message: string;
}
const places = ['1호기', '2호기', '냉각 설비', '포장 라인', '출하장'];
const messages = ['정상 가동', '온도 점검 필요', '정기 점검 완료', '재고 보충 요청', '출고 대기'];
// 제목 줄이 없어도 뜻이 통하는 표(알림 목록, 로그 등)에는 showHeader: false를 써요.
export const options: GridOptions<Row> = {
columns: [
{ id: 'time', title: '시각', width: 90 },
{ id: 'place', title: '장소', width: 120 },
{ id: 'message', title: '내용', width: 220 },
],
rows: Array.from({ length: 8 }, (_, i) => ({
id: i + 1,
time: `09:${String(5 + i * 7).padStart(2, '0')}`,
place: places[i % 5] as string,
message: messages[(i * 2) % 5] as string,
})),
rowKey: 'id',
showHeader: false,
};
export const actions = {
header: (api: GridApi<Row>, value?: string) => {
const show = value === 'show';
// 헤더가 없으면 정렬 상태를 눈으로 확인할 수도, 바꿀 수도 없어요. 숨길 때 정렬을 함께 풀어요.
if (!show) api.setSortModel([]);
api.setOptions({ showHeader: show });
},
};버튼을 누르면 이 예제의 코드가 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.header(api, ($event.target as HTMLSelectElement).value)"
>
<option value="hide" selected>감추기</option>
<option value="show">보이기</option>
</select>
</div>
<Grid style="height: 298px" :options="options" @ready="onReady" />
</template>import type { GridApi, GridOptions } from '@maxgrid/vue';
export interface Row {
id: number;
time: string;
place: string;
message: string;
}
const places = ['1호기', '2호기', '냉각 설비', '포장 라인', '출하장'];
const messages = ['정상 가동', '온도 점검 필요', '정기 점검 완료', '재고 보충 요청', '출고 대기'];
// 제목 줄이 없어도 뜻이 통하는 표(알림 목록, 로그 등)에는 showHeader: false를 써요.
export const options: GridOptions<Row> = {
columns: [
{ id: 'time', title: '시각', width: 90 },
{ id: 'place', title: '장소', width: 120 },
{ id: 'message', title: '내용', width: 220 },
],
rows: Array.from({ length: 8 }, (_, i) => ({
id: i + 1,
time: `09:${String(5 + i * 7).padStart(2, '0')}`,
place: places[i % 5] as string,
message: messages[(i * 2) % 5] as string,
})),
rowKey: 'id',
showHeader: false,
};
export const actions = {
header: (api: GridApi<Row>, value?: string) => {
const show = value === 'show';
// 헤더가 없으면 정렬 상태를 눈으로 확인할 수도, 바꿀 수도 없어요. 숨길 때 정렬을 함께 풀어요.
if (!show) api.setSortModel([]);
api.setOptions({ showHeader: show });
},
};버튼을 누르면 이 예제의 코드가 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.header(api, $any($event.target).value)"
>
<option value="hide" selected>감추기</option>
<option value="show">보이기</option>
</select>
</div>
<mx-grid style="height: 298px" [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;
time: string;
place: string;
message: string;
}
const places = ['1호기', '2호기', '냉각 설비', '포장 라인', '출하장'];
const messages = ['정상 가동', '온도 점검 필요', '정기 점검 완료', '재고 보충 요청', '출고 대기'];
// 제목 줄이 없어도 뜻이 통하는 표(알림 목록, 로그 등)에는 showHeader: false를 써요.
export const options: GridOptions<Row> = {
columns: [
{ id: 'time', title: '시각', width: 90 },
{ id: 'place', title: '장소', width: 120 },
{ id: 'message', title: '내용', width: 220 },
],
rows: Array.from({ length: 8 }, (_, i) => ({
id: i + 1,
time: `09:${String(5 + i * 7).padStart(2, '0')}`,
place: places[i % 5] as string,
message: messages[(i * 2) % 5] as string,
})),
rowKey: 'id',
showHeader: false,
};
export const actions = {
header: (api: GridApi<Row>, value?: string) => {
const show = value === 'show';
// 헤더가 없으면 정렬 상태를 눈으로 확인할 수도, 바꿀 수도 없어요. 숨길 때 정렬을 함께 풀어요.
if (!show) api.setSortModel([]);
api.setOptions({ showHeader: show });
},
};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="Header" id="header">
<option value="hide" selected>Hidden</option>
<option value="show">Show header</option>
</select>
</div>
<div id="grid" style="height: 298px"></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('header').addEventListener('change', (event) => actions.header(api, event.target.value));const places = ['Unit 1', 'Unit 2', 'Cooling plant', 'Packing line', 'Shipping dock'];
const messages = [
'Running normally',
'Temperature check needed',
'Routine check done',
'Restock requested',
'Awaiting shipment',
];
// Use showHeader: false for tables that make sense without a title row (notification lists, logs and so on).
export const options = {
columns: [
{ id: 'time', title: 'Time', width: 90 },
{ id: 'place', title: 'Place', width: 130 },
{ id: 'message', title: 'Message', width: 220 },
],
rows: Array.from({ length: 8 }, (_, i) => ({
id: i + 1,
time: `09:${String(5 + i * 7).padStart(2, '0')}`,
place: places[i % 5],
message: messages[(i * 2) % 5],
})),
rowKey: 'id',
showHeader: false,
};
export const actions = {
header: (api, value) => {
const show = value === 'show';
// Without a header you can neither see nor change the sort state, so the sort is cleared when hiding.
if (!show)
api.setSortModel([]);
api.setOptions({ showHeader: show });
},
};<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Show a list without a header row</title>
</head>
<body>
<div class="toolbar">
<select aria-label="Header" id="header">
<option value="hide" selected>Hidden</option>
<option value="show">Show header</option>
</select>
</div>
<div id="grid" style="height: 298px"></div>
<script src="https://cdn.maxmine.com/maxgrid/latest/maxgrid.min.js"></script>
<script>
const places = ['Unit 1', 'Unit 2', 'Cooling plant', 'Packing line', 'Shipping dock'];
const messages = [
'Running normally',
'Temperature check needed',
'Routine check done',
'Restock requested',
'Awaiting shipment',
];
// Use showHeader: false for tables that make sense without a title row (notification lists, logs and so on).
const options = {
columns: [
{ id: 'time', title: 'Time', width: 90 },
{ id: 'place', title: 'Place', width: 130 },
{ id: 'message', title: 'Message', width: 220 },
],
rows: Array.from({ length: 8 }, (_, i) => ({
id: i + 1,
time: `09:${String(5 + i * 7).padStart(2, '0')}`,
place: places[i % 5],
message: messages[(i * 2) % 5],
})),
rowKey: 'id',
showHeader: false,
};
const actions = {
header: (api, value) => {
const show = value === 'show';
// Without a header you can neither see nor change the sort state, so the sort is cleared when hiding.
if (!show)
api.setSortModel([]);
api.setOptions({ showHeader: show });
},
};
options.ariaLabel = "Show a list without a header row";
const api = MaxGrid.createGrid(document.getElementById('grid'), options);
document.getElementById('header').addEventListener('change', (event) => actions.header(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="Header"
disabled={!api}
onChange={(event) => api && actions.header(api, event.target.value)}
>
<option value="hide">Hidden</option>
<option value="show">Show header</option>
</select>
</div>
<Grid style={{ height: 298 }} ref={gridRef} options={options} />
</>
);
}import type { GridApi, GridOptions } from '@maxgrid/react';
export interface Row {
id: number;
time: string;
place: string;
message: string;
}
const places = ['Unit 1', 'Unit 2', 'Cooling plant', 'Packing line', 'Shipping dock'];
const messages = [
'Running normally',
'Temperature check needed',
'Routine check done',
'Restock requested',
'Awaiting shipment',
];
// Use showHeader: false for tables that make sense without a title row (notification lists, logs and so on).
export const options: GridOptions<Row> = {
columns: [
{ id: 'time', title: 'Time', width: 90 },
{ id: 'place', title: 'Place', width: 130 },
{ id: 'message', title: 'Message', width: 220 },
],
rows: Array.from({ length: 8 }, (_, i) => ({
id: i + 1,
time: `09:${String(5 + i * 7).padStart(2, '0')}`,
place: places[i % 5] as string,
message: messages[(i * 2) % 5] as string,
})),
rowKey: 'id',
showHeader: false,
};
export const actions = {
header: (api: GridApi<Row>, value?: string) => {
const show = value === 'show';
// Without a header you can neither see nor change the sort state, so the sort is cleared when hiding.
if (!show) api.setSortModel([]);
api.setOptions({ showHeader: show });
},
};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="Header"
:disabled="!api"
@change="api && actions.header(api, ($event.target as HTMLSelectElement).value)"
>
<option value="hide" selected>Hidden</option>
<option value="show">Show header</option>
</select>
</div>
<Grid style="height: 298px" :options="options" @ready="onReady" />
</template>import type { GridApi, GridOptions } from '@maxgrid/vue';
export interface Row {
id: number;
time: string;
place: string;
message: string;
}
const places = ['Unit 1', 'Unit 2', 'Cooling plant', 'Packing line', 'Shipping dock'];
const messages = [
'Running normally',
'Temperature check needed',
'Routine check done',
'Restock requested',
'Awaiting shipment',
];
// Use showHeader: false for tables that make sense without a title row (notification lists, logs and so on).
export const options: GridOptions<Row> = {
columns: [
{ id: 'time', title: 'Time', width: 90 },
{ id: 'place', title: 'Place', width: 130 },
{ id: 'message', title: 'Message', width: 220 },
],
rows: Array.from({ length: 8 }, (_, i) => ({
id: i + 1,
time: `09:${String(5 + i * 7).padStart(2, '0')}`,
place: places[i % 5] as string,
message: messages[(i * 2) % 5] as string,
})),
rowKey: 'id',
showHeader: false,
};
export const actions = {
header: (api: GridApi<Row>, value?: string) => {
const show = value === 'show';
// Without a header you can neither see nor change the sort state, so the sort is cleared when hiding.
if (!show) api.setSortModel([]);
api.setOptions({ showHeader: show });
},
};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="Header"
[disabled]="!api"
(change)="api && actions.header(api, $any($event.target).value)"
>
<option value="hide" selected>Hidden</option>
<option value="show">Show header</option>
</select>
</div>
<mx-grid style="height: 298px" [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;
time: string;
place: string;
message: string;
}
const places = ['Unit 1', 'Unit 2', 'Cooling plant', 'Packing line', 'Shipping dock'];
const messages = [
'Running normally',
'Temperature check needed',
'Routine check done',
'Restock requested',
'Awaiting shipment',
];
// Use showHeader: false for tables that make sense without a title row (notification lists, logs and so on).
export const options: GridOptions<Row> = {
columns: [
{ id: 'time', title: 'Time', width: 90 },
{ id: 'place', title: 'Place', width: 130 },
{ id: 'message', title: 'Message', width: 220 },
],
rows: Array.from({ length: 8 }, (_, i) => ({
id: i + 1,
time: `09:${String(5 + i * 7).padStart(2, '0')}`,
place: places[i % 5] as string,
message: messages[(i * 2) % 5] as string,
})),
rowKey: 'id',
showHeader: false,
};
export const actions = {
header: (api: GridApi<Row>, value?: string) => {
const show = value === 'show';
// Without a header you can neither see nor change the sort state, so the sort is cleared when hiding.
if (!show) api.setSortModel([]);
api.setOptions({ showHeader: show });
},
};