Added bidirectional linking (BIG DIFF)

This commit is contained in:
Janet Vorobyeva
2023-09-05 09:22:55 -07:00
parent 1b1970c075
commit d3126bec62
7 changed files with 215 additions and 26 deletions

View File

@@ -1,4 +1,5 @@
import BaseView from 'app/client/components/BaseView';
import {SequenceNEVER, SequenceNum} from 'app/client/components/Cursor';
import {EmptyFilterColValues, LinkingState} from 'app/client/components/LinkingState';
import {KoArray} from 'app/client/lib/koArray';
import {ColumnToMapImpl} from 'app/client/models/ColumnToMap';
@@ -155,6 +156,8 @@ export interface ViewSectionRec extends IRowModel<"_grist_Views_section">, RuleO
activeRowId: ko.Observable<UIRowId | null>; // May be null when there are no rows.
lastCursorEdit: ko.Observable<SequenceNum>;
// If the view instance for section is instantiated, it will be accessible here.
viewInstance: ko.Observable<BaseView | null>;
@@ -618,6 +621,7 @@ export function createViewSectionRec(this: ViewSectionRec, docModel: DocModel):
this.linkTargetCol = refRecord(docModel.columns, this.linkTargetColRef);
this.activeRowId = ko.observable<UIRowId|null>(null);
this.lastCursorEdit = ko.observable<SequenceNum>(SequenceNEVER);
this._linkingState = Holder.create(this);
this.linkingState = this.autoDispose(ko.pureComputed(() => {