셀에 마우스를 올리면 말풍선Tooltips on cells
컬럼에서 말풍선을 켜면 셀에 마우스를 올릴 때(터치는 누를 때) 설명이 떠요. '켬'은 보이는 글자 전체를 보여 줘서 잘린 글을 읽을 수 있고, 행마다 다른 설명을 달 수도 있어요.Turn on a column's tooltip and a bubble appears on hover (or press on touch). Plain on shows the full cell text for cut-off values, and each row can have its own text.
코드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 id="grid" style="height: 200px"></div>
</div>
<script type="module" src="./main.js"></script>import { createGrid } from 'maxgrid';
import { options } from './example';
const api = createGrid(document.getElementById('grid'), options);// tooltip: true면 셀에 보이는 글자를 그대로 말풍선으로 보여 줘요. 칸이 좁아 글자가 잘려도 마우스를 올리면 끝까지 읽혀요.
// 함수를 주면 행마다 다른 설명을 달 수 있어요(undefined를 돌려주면 그 셀은 말풍선이 없어요).
export const options = {
tooltipDelay: 150,
columns: [
{ id: 'id', title: '번호', width: 70, align: 'end' },
{ id: 'product', title: '품명', width: 140 },
{ id: 'description', title: '설명 (올려 보세요)', width: 200, tooltip: true },
{
id: 'stock',
title: '재고',
kind: 'number',
width: 90,
align: 'end',
tooltip: (row) => row.stock < 20 ? `안전 재고(20개)보다 ${20 - row.stock}개 부족해요` : undefined,
},
],
rows: [
{
id: 1,
product: '핸드 파레트 트럭',
description: '수동 유압식 2.5톤, 포크 길이 1,150mm, 바퀴 폴리우레탄',
stock: 14,
},
{
id: 2,
product: '라벨 프린터',
description: '4인치 배송 라벨용 열전사 프린터, USB와 랜 연결 지원',
stock: 6,
},
{
id: 3,
product: '스트레치 필름',
description: '투명 스트레치 필름 500mm x 300m, 17미크론, 6롤 1박스',
stock: 120,
},
{
id: 4,
product: '철제 선반',
description: '조립식 5단 선반, 한 단 하중 200kg, 폭 900mm',
stock: 31,
},
],
rowKey: 'id',
};<!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 id="grid" style="height: 200px"></div>
<script src="https://cdn.maxmine.com/maxgrid/latest/maxgrid.min.js"></script>
<script>
// tooltip: true면 셀에 보이는 글자를 그대로 말풍선으로 보여 줘요. 칸이 좁아 글자가 잘려도 마우스를 올리면 끝까지 읽혀요.
// 함수를 주면 행마다 다른 설명을 달 수 있어요(undefined를 돌려주면 그 셀은 말풍선이 없어요).
const options = {
tooltipDelay: 150,
columns: [
{ id: 'id', title: '번호', width: 70, align: 'end' },
{ id: 'product', title: '품명', width: 140 },
{ id: 'description', title: '설명 (올려 보세요)', width: 200, tooltip: true },
{
id: 'stock',
title: '재고',
kind: 'number',
width: 90,
align: 'end',
tooltip: (row) => row.stock < 20 ? `안전 재고(20개)보다 ${20 - row.stock}개 부족해요` : undefined,
},
],
rows: [
{
id: 1,
product: '핸드 파레트 트럭',
description: '수동 유압식 2.5톤, 포크 길이 1,150mm, 바퀴 폴리우레탄',
stock: 14,
},
{
id: 2,
product: '라벨 프린터',
description: '4인치 배송 라벨용 열전사 프린터, USB와 랜 연결 지원',
stock: 6,
},
{
id: 3,
product: '스트레치 필름',
description: '투명 스트레치 필름 500mm x 300m, 17미크론, 6롤 1박스',
stock: 120,
},
{
id: 4,
product: '철제 선반',
description: '조립식 5단 선반, 한 단 하중 200kg, 폭 900mm',
stock: 31,
},
],
rowKey: 'id',
};
options.ariaLabel = "셀에 마우스를 올리면 말풍선";
const api = MaxGrid.createGrid(document.getElementById('grid'), options);
</script>
</body>
</html>버튼을 누르면 이 예제의 코드가 StackBlitz나 CodeSandbox로 전송돼요. 누르기 전에는 아무것도 보내지 않아요.
import { Grid } from '@maxgrid/react';
import { options, type Row } from './example';
export function ExampleGrid() {
return (
<>
<Grid style={{ height: 200 }} options={options} />
</>
);
}import type { GridOptions } from '@maxgrid/react';
export interface Row {
id: number;
product: string;
description: string;
stock: number;
}
// tooltip: true면 셀에 보이는 글자를 그대로 말풍선으로 보여 줘요. 칸이 좁아 글자가 잘려도 마우스를 올리면 끝까지 읽혀요.
// 함수를 주면 행마다 다른 설명을 달 수 있어요(undefined를 돌려주면 그 셀은 말풍선이 없어요).
export const options: GridOptions<Row> = {
tooltipDelay: 150,
columns: [
{ id: 'id', title: '번호', width: 70, align: 'end' },
{ id: 'product', title: '품명', width: 140 },
{ id: 'description', title: '설명 (올려 보세요)', width: 200, tooltip: true },
{
id: 'stock',
title: '재고',
kind: 'number',
width: 90,
align: 'end',
tooltip: (row) =>
row.stock < 20 ? `안전 재고(20개)보다 ${20 - row.stock}개 부족해요` : undefined,
},
],
rows: [
{
id: 1,
product: '핸드 파레트 트럭',
description: '수동 유압식 2.5톤, 포크 길이 1,150mm, 바퀴 폴리우레탄',
stock: 14,
},
{
id: 2,
product: '라벨 프린터',
description: '4인치 배송 라벨용 열전사 프린터, USB와 랜 연결 지원',
stock: 6,
},
{
id: 3,
product: '스트레치 필름',
description: '투명 스트레치 필름 500mm x 300m, 17미크론, 6롤 1박스',
stock: 120,
},
{
id: 4,
product: '철제 선반',
description: '조립식 5단 선반, 한 단 하중 200kg, 폭 900mm',
stock: 31,
},
],
rowKey: 'id',
};버튼을 누르면 이 예제의 코드가 StackBlitz나 CodeSandbox로 전송돼요. 누르기 전에는 아무것도 보내지 않아요.
<script setup lang="ts">
import { Grid } from '@maxgrid/vue';
import { options, type Row } from './example';
</script>
<template>
<Grid style="height: 200px" :options="options" />
</template>import type { GridOptions } from '@maxgrid/vue';
export interface Row {
id: number;
product: string;
description: string;
stock: number;
}
// tooltip: true면 셀에 보이는 글자를 그대로 말풍선으로 보여 줘요. 칸이 좁아 글자가 잘려도 마우스를 올리면 끝까지 읽혀요.
// 함수를 주면 행마다 다른 설명을 달 수 있어요(undefined를 돌려주면 그 셀은 말풍선이 없어요).
export const options: GridOptions<Row> = {
tooltipDelay: 150,
columns: [
{ id: 'id', title: '번호', width: 70, align: 'end' },
{ id: 'product', title: '품명', width: 140 },
{ id: 'description', title: '설명 (올려 보세요)', width: 200, tooltip: true },
{
id: 'stock',
title: '재고',
kind: 'number',
width: 90,
align: 'end',
tooltip: (row) =>
row.stock < 20 ? `안전 재고(20개)보다 ${20 - row.stock}개 부족해요` : undefined,
},
],
rows: [
{
id: 1,
product: '핸드 파레트 트럭',
description: '수동 유압식 2.5톤, 포크 길이 1,150mm, 바퀴 폴리우레탄',
stock: 14,
},
{
id: 2,
product: '라벨 프린터',
description: '4인치 배송 라벨용 열전사 프린터, USB와 랜 연결 지원',
stock: 6,
},
{
id: 3,
product: '스트레치 필름',
description: '투명 스트레치 필름 500mm x 300m, 17미크론, 6롤 1박스',
stock: 120,
},
{
id: 4,
product: '철제 선반',
description: '조립식 5단 선반, 한 단 하중 200kg, 폭 900mm',
stock: 31,
},
],
rowKey: 'id',
};버튼을 누르면 이 예제의 코드가 StackBlitz나 CodeSandbox로 전송돼요. 누르기 전에는 아무것도 보내지 않아요.
import { Component } from '@angular/core';
import { GridComponent } from '@maxgrid/angular';
import { options, type Row } from './example';
@Component({
selector: 'app-example-grid',
standalone: true,
imports: [GridComponent],
template: `
<mx-grid style="height: 200px" [options]="options" />
`,
})
export class ExampleGridComponent {
readonly options = options;
}import type { GridOptions } from '@maxgrid/angular';
export interface Row {
id: number;
product: string;
description: string;
stock: number;
}
// tooltip: true면 셀에 보이는 글자를 그대로 말풍선으로 보여 줘요. 칸이 좁아 글자가 잘려도 마우스를 올리면 끝까지 읽혀요.
// 함수를 주면 행마다 다른 설명을 달 수 있어요(undefined를 돌려주면 그 셀은 말풍선이 없어요).
export const options: GridOptions<Row> = {
tooltipDelay: 150,
columns: [
{ id: 'id', title: '번호', width: 70, align: 'end' },
{ id: 'product', title: '품명', width: 140 },
{ id: 'description', title: '설명 (올려 보세요)', width: 200, tooltip: true },
{
id: 'stock',
title: '재고',
kind: 'number',
width: 90,
align: 'end',
tooltip: (row) =>
row.stock < 20 ? `안전 재고(20개)보다 ${20 - row.stock}개 부족해요` : undefined,
},
],
rows: [
{
id: 1,
product: '핸드 파레트 트럭',
description: '수동 유압식 2.5톤, 포크 길이 1,150mm, 바퀴 폴리우레탄',
stock: 14,
},
{
id: 2,
product: '라벨 프린터',
description: '4인치 배송 라벨용 열전사 프린터, USB와 랜 연결 지원',
stock: 6,
},
{
id: 3,
product: '스트레치 필름',
description: '투명 스트레치 필름 500mm x 300m, 17미크론, 6롤 1박스',
stock: 120,
},
{
id: 4,
product: '철제 선반',
description: '조립식 5단 선반, 한 단 하중 200kg, 폭 900mm',
stock: 31,
},
],
rowKey: 'id',
};When you click, the example code is sent to StackBlitz or CodeSandbox. Nothing is sent before you click.
<div id="app">
<div id="grid" style="height: 200px"></div>
</div>
<script type="module" src="./main.js"></script>import { createGrid } from 'maxgrid';
import { options } from './example';
const api = createGrid(document.getElementById('grid'), options);// tooltip: true shows the text visible in the cell as a bubble. Even if the cell is narrow and the text is cut off, hovering reads it to the end.
// A function can give each row a different note (return undefined and that cell has no bubble).
export const options = {
tooltipDelay: 150,
columns: [
{ id: 'id', title: 'No', width: 70, align: 'end' },
{ id: 'product', title: 'Product', width: 140 },
{ id: 'description', title: 'Description (hover)', width: 200, tooltip: true },
{
id: 'stock',
title: 'Stock',
kind: 'number',
width: 90,
align: 'end',
tooltip: (row) => row.stock < 20 ? `${20 - row.stock} short of the safety stock (20 units)` : undefined,
},
],
rows: [
{
id: 1,
product: 'Hand Pallet Truck',
description: 'Manual hydraulic 2.5 t, fork length 1,150 mm, polyurethane wheels',
stock: 14,
},
{
id: 2,
product: 'Label Printer',
description: 'Thermal transfer printer for 4-inch shipping labels, USB and LAN support',
stock: 6,
},
{
id: 3,
product: 'Stretch Film',
description: 'Clear stretch film 500mm x 300m, 17 micron, 6 rolls per box',
stock: 120,
},
{
id: 4,
product: 'Steel Shelf',
description: 'Assembled 5-tier shelf, 200kg per tier, width 900mm',
stock: 31,
},
],
rowKey: 'id',
};<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Tooltips on cells</title>
</head>
<body>
<div id="grid" style="height: 200px"></div>
<script src="https://cdn.maxmine.com/maxgrid/latest/maxgrid.min.js"></script>
<script>
// tooltip: true shows the text visible in the cell as a bubble. Even if the cell is narrow and the text is cut off, hovering reads it to the end.
// A function can give each row a different note (return undefined and that cell has no bubble).
const options = {
tooltipDelay: 150,
columns: [
{ id: 'id', title: 'No', width: 70, align: 'end' },
{ id: 'product', title: 'Product', width: 140 },
{ id: 'description', title: 'Description (hover)', width: 200, tooltip: true },
{
id: 'stock',
title: 'Stock',
kind: 'number',
width: 90,
align: 'end',
tooltip: (row) => row.stock < 20 ? `${20 - row.stock} short of the safety stock (20 units)` : undefined,
},
],
rows: [
{
id: 1,
product: 'Hand Pallet Truck',
description: 'Manual hydraulic 2.5 t, fork length 1,150 mm, polyurethane wheels',
stock: 14,
},
{
id: 2,
product: 'Label Printer',
description: 'Thermal transfer printer for 4-inch shipping labels, USB and LAN support',
stock: 6,
},
{
id: 3,
product: 'Stretch Film',
description: 'Clear stretch film 500mm x 300m, 17 micron, 6 rolls per box',
stock: 120,
},
{
id: 4,
product: 'Steel Shelf',
description: 'Assembled 5-tier shelf, 200kg per tier, width 900mm',
stock: 31,
},
],
rowKey: 'id',
};
options.ariaLabel = "Tooltips on cells";
const api = MaxGrid.createGrid(document.getElementById('grid'), options);
</script>
</body>
</html>When you click, the example code is sent to StackBlitz or CodeSandbox. Nothing is sent before you click.
import { Grid } from '@maxgrid/react';
import { options, type Row } from './example';
export function ExampleGrid() {
return (
<>
<Grid style={{ height: 200 }} options={options} />
</>
);
}import type { GridOptions } from '@maxgrid/react';
export interface Row {
id: number;
product: string;
description: string;
stock: number;
}
// tooltip: true shows the text visible in the cell as a bubble. Even if the cell is narrow and the text is cut off, hovering reads it to the end.
// A function can give each row a different note (return undefined and that cell has no bubble).
export const options: GridOptions<Row> = {
tooltipDelay: 150,
columns: [
{ id: 'id', title: 'No', width: 70, align: 'end' },
{ id: 'product', title: 'Product', width: 140 },
{ id: 'description', title: 'Description (hover)', width: 200, tooltip: true },
{
id: 'stock',
title: 'Stock',
kind: 'number',
width: 90,
align: 'end',
tooltip: (row) =>
row.stock < 20 ? `${20 - row.stock} short of the safety stock (20 units)` : undefined,
},
],
rows: [
{
id: 1,
product: 'Hand Pallet Truck',
description: 'Manual hydraulic 2.5 t, fork length 1,150 mm, polyurethane wheels',
stock: 14,
},
{
id: 2,
product: 'Label Printer',
description: 'Thermal transfer printer for 4-inch shipping labels, USB and LAN support',
stock: 6,
},
{
id: 3,
product: 'Stretch Film',
description: 'Clear stretch film 500mm x 300m, 17 micron, 6 rolls per box',
stock: 120,
},
{
id: 4,
product: 'Steel Shelf',
description: 'Assembled 5-tier shelf, 200kg per tier, width 900mm',
stock: 31,
},
],
rowKey: 'id',
};When you click, the example code is sent to StackBlitz or CodeSandbox. Nothing is sent before you click.
<script setup lang="ts">
import { Grid } from '@maxgrid/vue';
import { options, type Row } from './example';
</script>
<template>
<Grid style="height: 200px" :options="options" />
</template>import type { GridOptions } from '@maxgrid/vue';
export interface Row {
id: number;
product: string;
description: string;
stock: number;
}
// tooltip: true shows the text visible in the cell as a bubble. Even if the cell is narrow and the text is cut off, hovering reads it to the end.
// A function can give each row a different note (return undefined and that cell has no bubble).
export const options: GridOptions<Row> = {
tooltipDelay: 150,
columns: [
{ id: 'id', title: 'No', width: 70, align: 'end' },
{ id: 'product', title: 'Product', width: 140 },
{ id: 'description', title: 'Description (hover)', width: 200, tooltip: true },
{
id: 'stock',
title: 'Stock',
kind: 'number',
width: 90,
align: 'end',
tooltip: (row) =>
row.stock < 20 ? `${20 - row.stock} short of the safety stock (20 units)` : undefined,
},
],
rows: [
{
id: 1,
product: 'Hand Pallet Truck',
description: 'Manual hydraulic 2.5 t, fork length 1,150 mm, polyurethane wheels',
stock: 14,
},
{
id: 2,
product: 'Label Printer',
description: 'Thermal transfer printer for 4-inch shipping labels, USB and LAN support',
stock: 6,
},
{
id: 3,
product: 'Stretch Film',
description: 'Clear stretch film 500mm x 300m, 17 micron, 6 rolls per box',
stock: 120,
},
{
id: 4,
product: 'Steel Shelf',
description: 'Assembled 5-tier shelf, 200kg per tier, width 900mm',
stock: 31,
},
],
rowKey: 'id',
};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 } from '@maxgrid/angular';
import { options, type Row } from './example';
@Component({
selector: 'app-example-grid',
standalone: true,
imports: [GridComponent],
template: `
<mx-grid style="height: 200px" [options]="options" />
`,
})
export class ExampleGridComponent {
readonly options = options;
}import type { GridOptions } from '@maxgrid/angular';
export interface Row {
id: number;
product: string;
description: string;
stock: number;
}
// tooltip: true shows the text visible in the cell as a bubble. Even if the cell is narrow and the text is cut off, hovering reads it to the end.
// A function can give each row a different note (return undefined and that cell has no bubble).
export const options: GridOptions<Row> = {
tooltipDelay: 150,
columns: [
{ id: 'id', title: 'No', width: 70, align: 'end' },
{ id: 'product', title: 'Product', width: 140 },
{ id: 'description', title: 'Description (hover)', width: 200, tooltip: true },
{
id: 'stock',
title: 'Stock',
kind: 'number',
width: 90,
align: 'end',
tooltip: (row) =>
row.stock < 20 ? `${20 - row.stock} short of the safety stock (20 units)` : undefined,
},
],
rows: [
{
id: 1,
product: 'Hand Pallet Truck',
description: 'Manual hydraulic 2.5 t, fork length 1,150 mm, polyurethane wheels',
stock: 14,
},
{
id: 2,
product: 'Label Printer',
description: 'Thermal transfer printer for 4-inch shipping labels, USB and LAN support',
stock: 6,
},
{
id: 3,
product: 'Stretch Film',
description: 'Clear stretch film 500mm x 300m, 17 micron, 6 rolls per box',
stock: 120,
},
{
id: 4,
product: 'Steel Shelf',
description: 'Assembled 5-tier shelf, 200kg per tier, width 900mm',
stock: 31,
},
],
rowKey: 'id',
};