본문으로 건너뛰기Skip to content
예제 첫화면Examples home

라이선스 상태 확인하기 (평가 모드 표시)Check the license status (evaluation mode shown)

라이선스 키를 넣지 않아도 그리드는 평가 모드로 동작해요. 키가 확인되면 상태, 에디션, 이유를 알려 줘서 관리자 화면 같은 곳에서 직접 안내를 보여 줄 수 있어요. 이 갤러리의 번들은 개발자용이라 '유효, 개발용'으로 알려 와요.The grid runs in evaluation mode even without a license key. Once the key is checked it announces status, edition and reason, so you can show your own notice. This gallery's bundle is a developer build, so it reports valid and developer.

입문Beginner
직접 써 보기Live preview라이선스 상태 확인하기 (평가 모드 표시)Check the license status (evaluation mode shown)

코드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)

빌드 도구(Vite 등)를 쓰는 프로젝트용 모듈 파일이에요. 설치 없이 바로 돌려 보려면 HTML 탭이나 직접 해보기를 쓰세요.

버튼을 누르면 이 예제의 코드가 StackBlitz나 CodeSandbox로 전송돼요. 누르기 전에는 아무것도 보내지 않아요.

index.html
<div id="app">
  <div id="grid" style="height: 250px"></div>
</div>
<script type="module" src="./main.js"></script>
main.js
import { createGrid } from 'maxgrid';
import { options, setup } from './example';
const api = createGrid(document.getElementById('grid'), options);
setup(api, console.log);
example.js
export const options = {
  columns: [
    { id: 'name', title: '이름', width: 150 },
    { id: 'dept', title: '부서', width: 130 },
  ],
  rows: [
    { id: 1, name: '김민준', dept: '개발팀' },
    { id: 2, name: '이서연', dept: '디자인팀' },
    { id: 3, name: '박지호', dept: '영업팀' },
  ],
  rowKey: 'id',
  // 받은 키는 여기에 넣거나, 페이지에서 한 번만 MaxGrid.config({ licenseKey })로 정해요.
  // licenseKey: 'MXG1.…',
};
// 키가 없어도 그리드는 동작해요(평가 모드). 이 이벤트가 어떤 상태인지 알려 주니,
// 관리자 화면 같은 곳에서 직접 안내 문구를 보여 줄 때 쓸 수 있어요.
// 이벤트로 오는 값(valid, developer 같은 영문 코드)을 한글로 풀어서 보여 줘요. 모르는 값은 그대로 적어요.
const STATUS = {
  valid: '유효',
  invalid: '유효하지 않음',
  expired: '만료',
  evaluation: '평가 중',
  missing: '키 없음',
};
const EDITION = {
  developer: '개발용',
  standard: '표준',
  enterprise: '기업용',
};
const STATUS_EN = {
  valid: 'valid',
  invalid: 'invalid',
  expired: 'expired',
  evaluation: 'evaluation',
  missing: 'no key',
};
const EDITION_EN = {
  developer: 'developer',
  standard: 'standard',
  enterprise: 'enterprise',
};
const say = (map, value, none = '없음') => (value ? (map[value] ?? value) : none);
export function setup(api, log) {
  log({
    ko: '라이선스 상태 알림을 기다리는 중이에요',
    en: 'Waiting for the license status notice',
  });
  return api.on('licenseStatusChanged', (e) => log({
    ko: `상태 ${say(STATUS, e.status)}, 에디션 ${say(EDITION, e.edition)}, 이유 ${e.reason ?? '없음'}`,
    en: `Status ${say(STATUS_EN, e.status, 'none')}, edition ${say(EDITION_EN, e.edition, 'none')}, reason ${e.reason ?? 'none'}`,
  }));
}

Module files for a project with a bundler such as Vite. To run it with no setup, use the HTML tab or Try it.

When you click, the example code is sent to StackBlitz or CodeSandbox. Nothing is sent before you click.

index.html
<div id="app">
  <div id="grid" style="height: 250px"></div>
</div>
<script type="module" src="./main.js"></script>
main.js
import { createGrid } from 'maxgrid';
import { options, setup } from './example';
const api = createGrid(document.getElementById('grid'), options);
setup(api, console.log);
example.js
export const options = {
  columns: [
    { id: 'name', title: 'Name', width: 150 },
    { id: 'dept', title: 'Department', width: 130 },
  ],
  rows: [
    { id: 1, name: 'Liam Carter', dept: 'Dev' },
    { id: 2, name: 'Emma Stone', dept: 'Design' },
    { id: 3, name: 'Noah Reed', dept: 'Sales' },
  ],
  rowKey: 'id',
  // Put the key you received here, or set it once on the page with MaxGrid.config({ licenseKey }).
  // licenseKey: 'MXG1.…',
};
// The grid works without a key (evaluation mode). This event tells you the state,
// so you can use it to show your own notice text, for example on an admin screen.
// The English codes that arrive with the event (valid, developer and so on) are turned into readable words. Unknown values are written as they are.
const STATUS = {
  valid: 'valid',
  invalid: 'invalid',
  expired: 'expired',
  evaluation: 'evaluation',
  missing: 'no key',
};
const EDITION = {
  developer: 'developer',
  standard: 'standard',
  enterprise: 'enterprise',
};
const say = (map, value, none = 'none') => (value ? (map[value] ?? value) : none);
export function setup(api, log) {
  log('Waiting for the license status notice');
  return api.on('licenseStatusChanged', (e) => log(`Status ${say(STATUS, e.status)}, edition ${say(EDITION, e.edition)}, reason ${e.reason ?? 'none'}`));
}