mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 07:08:55 +02:00
chore(views/table): bring back restore state
This commit is contained in:
parent
727eeb6c74
commit
51b462f043
@ -80,9 +80,6 @@ export default class TableView extends ViewMode<StateInfo> {
|
||||
}
|
||||
|
||||
private async renderTable(el: HTMLElement) {
|
||||
const viewStorage = await this.viewStorage.restore();
|
||||
const initialState = viewStorage?.gridState;
|
||||
|
||||
const modules = [SortModule, FormatModule, InteractionModule, EditModule, ResizeColumnsModule, FrozenColumnsModule, PersistenceModule];
|
||||
for (const module of modules) {
|
||||
Tabulator.registerModule(module);
|
||||
@ -95,6 +92,8 @@ export default class TableView extends ViewMode<StateInfo> {
|
||||
const notes = await froca.getNotes(this.args.noteIds);
|
||||
const info = getPromotedAttributeInformation(this.parentNote);
|
||||
|
||||
const viewStorage = await this.viewStorage.restore();
|
||||
this.persistentData = viewStorage?.tableData || {};
|
||||
this.api = new Tabulator(el, {
|
||||
index: "noteId",
|
||||
columns: buildColumnDefinitions(info),
|
||||
@ -103,7 +102,8 @@ export default class TableView extends ViewMode<StateInfo> {
|
||||
persistenceWriterFunc: (_id, type: string, data: object) => {
|
||||
this.persistentData[type] = data;
|
||||
this.spacedUpdate.scheduleUpdate();
|
||||
}
|
||||
},
|
||||
persistenceReaderFunc: (_id, type: string) => this.persistentData[type],
|
||||
});
|
||||
this.setupEditing();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user