mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 10:15:52 +01:00
feat(book/table): set up sample grid
This commit is contained in:
21
apps/client/src/widgets/view_widgets/table_view/renderer.ts
Normal file
21
apps/client/src/widgets/view_widgets/table_view/renderer.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { createGrid, AllCommunityModule, ModuleRegistry } from "ag-grid-community";
|
||||
|
||||
ModuleRegistry.registerModules([ AllCommunityModule ]);
|
||||
|
||||
export default function renderTable(el: HTMLElement) {
|
||||
createGrid(el, {
|
||||
// Row Data: The data to be displayed.
|
||||
rowData: [
|
||||
{ make: "Tesla", model: "Model Y", price: 64950, electric: true },
|
||||
{ make: "Ford", model: "F-Series", price: 33850, electric: false },
|
||||
{ make: "Toyota", model: "Corolla", price: 29600, electric: false },
|
||||
],
|
||||
// Column Definitions: Defines the columns to be displayed.
|
||||
columnDefs: [
|
||||
{ field: "make" },
|
||||
{ field: "model" },
|
||||
{ field: "price" },
|
||||
{ field: "electric" }
|
||||
]
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user