mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 07:46:30 +01:00
chore(views/table): bring back editing attributes
This commit is contained in:
@@ -69,7 +69,7 @@ export function buildColumnDefinitions(info: PromotedAttributeInformation[]) {
|
||||
columnDefs.push({
|
||||
field: `labels.${name}`,
|
||||
title: title ?? name,
|
||||
editable: true
|
||||
editor: "input"
|
||||
// cellDataType: mapDataType(type),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -117,30 +117,16 @@ export default class TableView extends ViewMode<StateInfo> {
|
||||
const field = cell.getField();
|
||||
const newValue = cell.getValue();
|
||||
|
||||
console.log("Cell edited", field, newValue);
|
||||
if (field === "title") {
|
||||
server.put(`notes/${noteId}/title`, { title: newValue });
|
||||
return;
|
||||
}
|
||||
|
||||
if (field.startsWith("labels.")) {
|
||||
const labelName = field.split(".", 2)[1];
|
||||
setLabel(noteId, labelName, newValue);
|
||||
}
|
||||
});
|
||||
|
||||
// return {
|
||||
// onCellValueChanged(event) {
|
||||
// if (event.type !== "cellValueChanged") {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// const noteId = event.data.noteId;
|
||||
// const name = event.colDef.field;
|
||||
// if (!name) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// if (name.startsWith("labels.")) {
|
||||
// const labelName = name.split(".", 2)[1];
|
||||
// setLabel(noteId, labelName, newValue);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private setupDragging() {
|
||||
|
||||
Reference in New Issue
Block a user