diff --git a/apps/client/src/widgets/view_widgets/table_view/data.ts b/apps/client/src/widgets/view_widgets/table_view/data.ts
index c9034607f..8c5852808 100644
--- a/apps/client/src/widgets/view_widgets/table_view/data.ts
+++ b/apps/client/src/widgets/view_widgets/table_view/data.ts
@@ -1,8 +1,7 @@
import FNote from "../../../entities/fnote.js";
import type { LabelType } from "../../../services/promoted_attribute_definition_parser.js";
-import froca from "../../../services/froca.js";
-import { title } from "process";
import type { ColumnDefinition } from "tabulator-tables";
+import link from "../../../services/link.js";
export type TableData = {
noteId: string;
@@ -39,7 +38,6 @@ export function buildColumnDefinitions(info: PromotedAttributeInformation[]) {
headerSort: false,
hozAlign: "center",
formatter(cell) {
- console.log(cell);
const iconClass = cell.getValue();
return ``;
},
@@ -66,6 +64,21 @@ export function buildColumnDefinitions(info: PromotedAttributeInformation[]) {
});
}
+ // End actions
+ columnDefs.push({
+ title: "Open note",
+ width: 40,
+ hozAlign: "center",
+ formatter: () => ``,
+ cellClick: (e, cell) => {
+ const noteId = cell.getRow().getCell("noteId").getValue();
+ console.log("Got note ID", noteId);
+ if (noteId) {
+ link.goToLinkExt(e as MouseEvent, `#root/${noteId}`);
+ }
+ }
+ });
+
return columnDefs;
}
diff --git a/apps/client/src/widgets/view_widgets/table_view/index.ts b/apps/client/src/widgets/view_widgets/table_view/index.ts
index 0eb795fa8..017a595cd 100644
--- a/apps/client/src/widgets/view_widgets/table_view/index.ts
+++ b/apps/client/src/widgets/view_widgets/table_view/index.ts
@@ -81,7 +81,7 @@ export default class TableView extends ViewMode {
const viewStorage = await this.viewStorage.restore();
const initialState = viewStorage?.gridState;
- const modules = [SortModule, FormatModule];
+ const modules = [SortModule, FormatModule, InteractionModule];
for (const module of modules) {
Tabulator.registerModule(module);
}