Grid for displaying datasets.
https://luna.liriliri.io/?path=/story/data-grid
Add the following script and style to your page.
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-data-grid/luna-data-grid.css" />
<script src="//cdn.jsdelivr.net/npm/luna-data-grid/luna-data-grid.js"></script>
You can also get it on npm.
npm install luna-data-grid --save
import 'luna-data-grid/luna-data-grid.css'
import LunaDataGrid from 'luna-data-grid'
const dataGrid = new DataGrid(container, {
columns: [
{
id: 'name',
title: 'Name',
sortable: true,
},
{
id: 'site',
title: 'Site',
},
],
})
dataGrid.append({
name: 'Runoob',
site: 'www.runoob.com',
})
- columns(IColumn[]): Table columns.
- filter(string | RegExp | AnyFn): Data filter.
- height(number): Table height.
- maxHeight(number): Max table height.
- minHeight(number): Min table height.
Append row data.
Clear all data.
Remove row data.
Set data.
- comparator(AnyFn): Column sort comparator if sortable is true.
- id(string): Column id.
- sortable(boolean): Is column sortable.
- title(string): Column display name.
- weight(number): Column weight.
- selectable(boolean): Whether the node is selectable.