feat(sql_console): make columns resizable

This commit is contained in:
Elian Doran 2026-01-17 21:45:10 +02:00
parent c6896a4b33
commit 769f3db21c
No known key found for this signature in database

View File

@ -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}