Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(views/table): display note title when editing relation
Elian Dorane411f9932f48
diff --git a/apps/client/src/widgets/view_widgets/table_view/data.ts b/apps/client/src/widgets/view_widgets/table_view/data.tsindex 37240e71c0..2afd7b8516 100644--- a/apps/client/src/widgets/view_widgets/table_view/data.ts+++ b/apps/client/src/widgets/view_widgets/table_view/data.ts@@ -159,8 +159,6 @@ export async function buildRowDefinitions(parentNote: FNote, notes: FNote[], inf});}- console.log("Built row definitions", definitions);-return definitions;}diff --git a/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts b/apps/client/src/widgets/view_widgets/table_view/relation_editor.tsindex c6049026a2..9db63af14f 100644--- a/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts+++ b/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts@@ -1,6 +1,7 @@import { CellComponent } from "tabulator-tables";import note_autocomplete from "../../../services/note_autocomplete";import { loadReferenceLinkTitle } from "../../../services/link";+import froca from "../../../services/froca";export function RelationEditor(cell: CellComponent, onRendered, success, cancel, editorParams){//cell - the cell component for the editable cell@@ -20,7 +21,11 @@ export function RelationEditor(cell: CellComponent, onRendered, success, cancel,editor.style.boxSizing = "border-box";//Set value of editor to the current value of the cell- editor.value = cell.getValue();+ const noteId = cell.getValue();+ if (noteId) {+ const note = froca.getNoteFromCache(noteId);+ editor.value = note.title;+ }//set focus on the select box when the editor is selectedonRendered(function(){