diff options
Diffstat (limited to 'src/client/views')
| -rw-r--r-- | src/client/views/collections/CollectionNoteTakingView.tsx | 3 | ||||
| -rw-r--r-- | src/client/views/collections/CollectionNoteTakingViewFieldColumn.tsx | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionNoteTakingView.tsx b/src/client/views/collections/CollectionNoteTakingView.tsx index 4e2bdbfa5..d3b3778a7 100644 --- a/src/client/views/collections/CollectionNoteTakingView.tsx +++ b/src/client/views/collections/CollectionNoteTakingView.tsx @@ -121,7 +121,8 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti let changed = false; this.filteredChildren.map(d => { if (!d[this.pivotField]) { - d[this.pivotField] = `New Column` + d[this.pivotField] = columnHeaders.length > 0 ? columnHeaders[0].heading : `New Column` + // d[this.pivotField] = columnHeaders[0].heading }; const sectionValue = d[this.pivotField] as object; // the next five lines ensures that floating point rounding errors don't create more than one section -syip diff --git a/src/client/views/collections/CollectionNoteTakingViewFieldColumn.tsx b/src/client/views/collections/CollectionNoteTakingViewFieldColumn.tsx index 1167a0ea8..8b7461fc0 100644 --- a/src/client/views/collections/CollectionNoteTakingViewFieldColumn.tsx +++ b/src/client/views/collections/CollectionNoteTakingViewFieldColumn.tsx @@ -187,11 +187,14 @@ export class CollectionNoteTakingViewFieldColumn extends React.Component<CSVFiel const layoutItems: ContextMenuProps[] = []; const docItems: ContextMenuProps[] = []; const dataDoc = this.props.DataDoc || this.props.Document; + const pivotValue = this.getValue(this.props.heading); DocUtils.addDocumentCreatorMenuItems((doc) => { + const key = this.props.pivotField; + doc[key] = this.getValue(this.props.heading); FormattedTextBox.SelectOnLoad = doc[Id]; return this.props.addDocument?.(doc); - }, this.props.addDocument, x, y, true); + }, this.props.addDocument, x, y, true, this.props.pivotField, pivotValue); Array.from(Object.keys(Doc.GetProto(dataDoc))).filter(fieldKey => dataDoc[fieldKey] instanceof RichTextField || dataDoc[fieldKey] instanceof ImageField || typeof (dataDoc[fieldKey]) === "string").map(fieldKey => docItems.push({ |
