aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionStackingView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-05-20 12:26:36 -0400
committerbobzel <zzzman@gmail.com>2025-05-20 12:26:36 -0400
commitfdaecd254fe56c5dab5b45258d6595ff9c5bcf42 (patch)
treeafebcfbf1d19180c80de3a811359e4dc17467a15 /src/client/views/collections/CollectionStackingView.tsx
parent33b8f9d1b08f9073dc996c97b82ca6a21c1e10ec (diff)
fixed creating list of headers in stacking view when it doesn't exist. start of making fields dropdown more reactive.
Diffstat (limited to 'src/client/views/collections/CollectionStackingView.tsx')
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index cc514f262..4a0ddc631 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -69,7 +69,7 @@ export class CollectionStackingView extends CollectionSubView<Partial<collection
return this._props.chromeHidden || BoolCast(this.layoutDoc.chromeHidden);
}
@computed get colHeaderData() {
- return Cast(this.dataDoc['_' + this.fieldKey + '_columnHeaders'], listSpec(SchemaHeaderField), null);
+ return Cast(this.dataDoc[this.fieldKey + '_columnHeaders'], listSpec(SchemaHeaderField), null);
}
@computed get Sections() {
@@ -192,7 +192,7 @@ export class CollectionStackingView extends CollectionSubView<Partial<collection
// reset section headers when a new filter is inputted
this._disposers.pivotField = reaction(
() => this.pivotField,
- () => (this.dataDoc['_' + this.fieldKey + '_columnHeaders'] = new List())
+ () => (this.dataDoc[this.fieldKey + '_columnHeaders'] = new List())
);
// reset section headers when a new filter is inputted
this._disposers.width = reaction(
@@ -595,6 +595,9 @@ export class CollectionStackingView extends CollectionSubView<Partial<collection
/// add a new group category (column) to the active set of note categories. (e.g., if the pivot field is 'transportation', groups might be 'car', 'plane', 'bike', etc)
@action
addGroup = (value: string) => {
+ if (!this.colHeaderData) {
+ this.dataDoc[this.fieldKey + '_columnHeaders'] = new List();
+ }
if (value && this.colHeaderData) {
this.colHeaderData.push(new SchemaHeaderField(value));
return true;
@@ -723,7 +726,7 @@ export class CollectionStackingView extends CollectionSubView<Partial<collection
<EditableView {...editableViewProps} />
</div>
<div style={{ right: 0, top: 0, position: 'absolute', display: !this.layoutDoc._pivotField ? 'none' : undefined }}>
- <FieldsDropdown Doc={this.Document} selectFunc={fieldKey => (this.layoutDoc._pivotField = fieldKey)} placeholder={StrCast(this.layoutDoc._pivotField)} />
+ <FieldsDropdown Doc={this.Document} isInactive={!this._props.isContentActive()} selectFunc={fieldKey => (this.layoutDoc._pivotField = fieldKey)} placeholder={StrCast(this.layoutDoc._pivotField)} />
</div>
</div>
</div>