- Data Grid docs
- Start here
Data Grid
A data grid for records that stays fast at a million rows, reads Excel and CSV files, talks to your server and exports what the user sees.
8sheets Data Grid shows a table of records and lets people work with it: search, filter, sort, group, total, pivot, chart, select, edit and export, as a list or as a tree. It runs in plain JavaScript modules with no runtime dependencies. Files are read in a Worker, the page keeps a bounded number of rows in the DOM, and a million records stay responsive. Server data plugs in through one query contract, so search, filters and totals always cover the whole result rather than the rows on screen.
It is an add-on to 8sheets Spreadsheet, with its own version and changelog, covered by the same company licence.
What it does
| Feature | What you get | Example |
|---|---|---|
| Local files and arrays | XLSX, XLSM, XLTX, CSV and TSV read as a stream in a Worker; arrays of objects, arrays of rows or typed-array columns | sales |
| Remote data and infinite scrolling | Rows load in cached 100-row blocks as the user scrolls; the total may be unknown | server |
| Live data | Your updates, added and removed records applied in batches, with the changed cells flashing | live |
| Search and filters | Search box, a filter builder with "all" and "any" groups, a filter row with >100 and 10..20 syntax, and Find | filters, large |
| Sorting and grouping | Multi-column sort, nested groups with summaries, saved views | sales |
| Tree data | Records under their parents, from a parent field or an outline level, with roll-ups | tree |
| Totals | A totals row with sum, average, min, max or count per column, over every matching record | columns |
| Pivot reports | Several row, column and value fields, values as shares, running totals or ranks, a chart; locally or on your server | pivot |
| Columns | Resize, autosize, reorder, pin, hide and rename, with bands over the headings | columns |
| Conditional formatting | Data bars, colour scales and value rules | columns |
| Sparklines and charts | A line, column or win/loss chart in each cell, and a chart of the selected cells | live |
| Cell renderers | Your own text or DOM node in a column's cells | |
| Themes | Light, dark, named skins or your own colour tokens; three row densities; six interface languages | |
| Row selection | Checkboxes, select every match without storing each record | selection |
| Editing | In-cell editing with lists, date pickers and check boxes, field rules, calculated fields, a fill handle, undo and redo | edit |
| Pinned rows, moving and numbers | Records kept on top or at the bottom, rows moved by dragging or between grids, row numbers | live |
| Context menu | Copy, filter by value, sort, chart, pin and more on a right-click, with your own commands | live |
| Export | The matching or selected records as CSV, XLSX or PDF, flat or with groups, totals and formatting | report, selection |
| Master/detail | Panels of your own under expanded records, one or several at a time | detail |
| Assistant | A view described in words, turned into a checked view state by your own service | ask |
Every example also opens in the grid's other languages: add &lang=pl (or de, fr, es, ja) to its address.
A first grid
JavaScript
import { mountTable } from '@8sheets/data-grid';
const grid = await mountTable(document.querySelector('#orders'), {
title: 'Orders',
fields: [
{ name: 'Region', type: 'string' },
{ name: 'Units', type: 'number' },
{ name: 'Price', type: 'number', format: '#,##0.00' },
],
data: [
{ Region: 'East', Units: 2, Price: 24 },
{ Region: 'West', Units: 5, Price: 3.5 },
],
});React
import { DataGrid } from '@8sheets/data-grid-react';
const options = {
title: 'Orders',
fields: [
{ name: 'Region', type: 'string' },
{ name: 'Units', type: 'number' },
{ name: 'Price', type: 'number', format: '#,##0.00' },
],
data: [
{ Region: 'East', Units: 2, Price: 24 },
{ Region: 'West', Units: 5, Price: 3.5 },
],
};
export function Orders() {
return (
<div style={{ height: 480 }}>
<DataGrid options={options} />
</div>
);
}Vue
<script setup>
import { DataGrid } from '@8sheets/data-grid-vue';
const options = {
title: 'Orders',
fields: [
{ name: 'Region', type: 'string' },
{ name: 'Units', type: 'number' },
{ name: 'Price', type: 'number', format: '#,##0.00' },
],
data: [
{ Region: 'East', Units: 2, Price: 24 },
{ Region: 'West', Units: 5, Price: 3.5 },
],
};
</script>
<template>
<div style="height: 480px"><DataGrid :options="options" /></div>
</template>Angular
import { Component } from '@angular/core';
import { DataGridComponent, DataGridOptions } from '@8sheets/data-grid-angular';
@Component({
selector: 'app-orders',
imports: [DataGridComponent],
template: `<eight-data-grid [options]="options" style="height: 480px" />`,
})
export class Orders {
options: DataGridOptions = {
title: 'Orders',
fields: [
{ name: 'Region', type: 'string' },
{ name: 'Units', type: 'number' },
{ name: 'Price', type: 'number', format: '#,##0.00' },
],
data: [
{ Region: 'East', Units: 2, Price: 24 },
{ Region: 'West', Units: 5, Price: 3.5 },
],
};
}Getting started covers installation, bundlers and the source download.
How it is built
- A Worker per grid. Reading files, filtering, sorting, grouping and totals run off the main thread. The page only draws.
- Columns, not objects. Records are stored as typed-array columns. Large arrays of objects are packed into columns in short slices before they reach the Worker, so the page doesn't freeze while they are copied.
- A bounded DOM. Only the rows and columns near the viewport are drawn, however large the result.
- A method for everything. Whatever a user can do in the grid, your code can do through its API, and both fire the same events:
stateChange,change,beforeEdit,loadEndand more. - The whole result counts. Search, filters, totals, data bars and exports always cover every matching record, locally and through a server source.
Limits
- The grid shows one table of records. For formulas across sheets, charts and Excel workbooks as a whole, use Spreadsheet.
- The interface is in English, Polish, German, French, Spanish and Japanese. The German, French, Spanish and Japanese texts are machine translations, not yet reviewed.
- Calculated fields, the fill handle, Find, transactions and layout exports need local data. A server source builds pivots only when it has a
pivotmethod.