mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +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({
|
columnDefs.push({
|
||||||
field: `labels.${name}`,
|
field: `labels.${name}`,
|
||||||
title: title ?? name,
|
title: title ?? name,
|
||||||
editable: true
|
editor: "input"
|
||||||
// cellDataType: mapDataType(type),
|
// cellDataType: mapDataType(type),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,30 +117,16 @@ export default class TableView extends ViewMode<StateInfo> {
|
|||||||
const field = cell.getField();
|
const field = cell.getField();
|
||||||
const newValue = cell.getValue();
|
const newValue = cell.getValue();
|
||||||
|
|
||||||
console.log("Cell edited", field, newValue);
|
|
||||||
if (field === "title") {
|
if (field === "title") {
|
||||||
server.put(`notes/${noteId}/title`, { title: newValue });
|
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() {
|
private setupDragging() {
|
||||||
|
|||||||
Reference in New Issue
Block a user