mirror of
https://github.com/zadam/trilium.git
synced 2026-01-23 15:04:25 +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 { useState } from "preact/hooks";
|
||||
import { ResizeColumnsModule } from "tabulator-tables";
|
||||
|
||||
import { t } from "../../services/i18n";
|
||||
import Tabulator from "../collections/table/tabulator";
|
||||
@ -60,13 +61,15 @@ function SqlResultTable({ rows }: { rows: object[] }) {
|
||||
return (
|
||||
<Tabulator
|
||||
layout="fitDataFill"
|
||||
modules={[ ResizeColumnsModule ]}
|
||||
columns={[
|
||||
...Object.keys(rows[0]).map(key => ({
|
||||
title: key,
|
||||
field: key,
|
||||
width: 250,
|
||||
minWidth: 100,
|
||||
maxWidth: 400,
|
||||
widthGrow: 1
|
||||
widthGrow: 1,
|
||||
resizable: true
|
||||
}))
|
||||
]}
|
||||
data={rows}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user