UNPKG

dkgrid

Version:

A utility class for creating Tabulator grids with JSON configs.

30 lines (25 loc) 793 B
``` // main.js import { TabulatorHandler } from 'tabulator-handler'; // 그리드를 렌더링할 컨테이너의 ID const gridContainerId = '#my-grid-container'; // 핸들러 인스턴스 생성 const tabulatorHandler = new TabulatorHandler(gridContainerId); // JSON 설정 (예시) const myConfig = { "height": "400px", "layout": "fitColumns", "usePaging": true, "paginationSize": 50, "columns": [ { "title": "이름", "field": "name" }, { "title": "성별", "field": "gender" } ] }; // 그리드 생성 tabulatorHandler.createGrid(JSON.stringify(myConfig)); // 엑셀 다운로드 document.getElementById('download-btn').addEventListener('click', () => { tabulatorHandler.downloadExcel('my-report.xlsx'); }); ```