mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
chore(views/table): reintroduce rows
This commit is contained in:
parent
30f7939616
commit
e09a7fb6e0
@ -1,7 +1,7 @@
|
||||
import froca from "../../../services/froca.js";
|
||||
import ViewMode, { type ViewModeArgs } from "../view_mode.js";
|
||||
import attributes, { setLabel } from "../../../services/attributes.js";
|
||||
import getPromotedAttributeInformation, { buildColumnDefinitions, buildData, TableData } from "./data.js";
|
||||
import getPromotedAttributeInformation, { buildColumnDefinitions, buildData, buildRowDefinitions, TableData } from "./data.js";
|
||||
import server from "../../../services/server.js";
|
||||
import SpacedUpdate from "../../../services/spaced_update.js";
|
||||
import branches from "../../../services/branches.js";
|
||||
@ -54,7 +54,7 @@ export default class TableView extends ViewMode<StateInfo> {
|
||||
private $container: JQuery<HTMLElement>;
|
||||
private args: ViewModeArgs;
|
||||
private spacedUpdate: SpacedUpdate;
|
||||
private api?: GridApi;
|
||||
private api?: Tabulator;
|
||||
private newAttribute?: Attribute;
|
||||
|
||||
constructor(args: ViewModeArgs) {
|
||||
@ -81,12 +81,21 @@ export default class TableView extends ViewMode<StateInfo> {
|
||||
const viewStorage = await this.viewStorage.restore();
|
||||
const initialState = viewStorage?.gridState;
|
||||
|
||||
this.api = new Tabulator(el, {
|
||||
});
|
||||
this.loadData();
|
||||
}
|
||||
|
||||
private async loadData() {
|
||||
if (!this.api) {
|
||||
return;
|
||||
}
|
||||
|
||||
const notes = await froca.getNotes(this.args.noteIds);
|
||||
const info = getPromotedAttributeInformation(this.parentNote);
|
||||
|
||||
const table = new Tabulator(el, {
|
||||
columns: buildColumnDefinitions(info)
|
||||
});
|
||||
this.api.setColumns(buildColumnDefinitions(info));
|
||||
this.api.setData(buildRowDefinitions(this.parentNote, notes, info));
|
||||
}
|
||||
|
||||
private onSave() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user