mirror of
https://github.com/zadam/trilium.git
synced 2026-02-26 16:43:36 +01:00
feat(sql_console): make columns resizable
This commit is contained in:
parent
c6896a4b33
commit
769f3db21c
@ -2,6 +2,7 @@ import "./SqlConsole.css";
|
|||||||
|
|
||||||
import { SqlExecuteResults } from "@triliumnext/commons";
|
import { SqlExecuteResults } from "@triliumnext/commons";
|
||||||
import { useState } from "preact/hooks";
|
import { useState } from "preact/hooks";
|
||||||
|
import { ResizeColumnsModule } from "tabulator-tables";
|
||||||
|
|
||||||
import { t } from "../../services/i18n";
|
import { t } from "../../services/i18n";
|
||||||
import Tabulator from "../collections/table/tabulator";
|
import Tabulator from "../collections/table/tabulator";
|
||||||
@ -60,13 +61,15 @@ function SqlResultTable({ rows }: { rows: object[] }) {
|
|||||||
return (
|
return (
|
||||||
<Tabulator
|
<Tabulator
|
||||||
layout="fitDataFill"
|
layout="fitDataFill"
|
||||||
|
modules={[ ResizeColumnsModule ]}
|
||||||
columns={[
|
columns={[
|
||||||
...Object.keys(rows[0]).map(key => ({
|
...Object.keys(rows[0]).map(key => ({
|
||||||
title: key,
|
title: key,
|
||||||
field: key,
|
field: key,
|
||||||
|
width: 250,
|
||||||
minWidth: 100,
|
minWidth: 100,
|
||||||
maxWidth: 400,
|
widthGrow: 1,
|
||||||
widthGrow: 1
|
resizable: true
|
||||||
}))
|
}))
|
||||||
]}
|
]}
|
||||||
data={rows}
|
data={rows}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user