diff options
Diffstat (limited to 'src/fields')
| -rw-r--r-- | src/fields/Document.ts | 8 | ||||
| -rw-r--r-- | src/fields/ListField.ts | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/fields/Document.ts b/src/fields/Document.ts index 4bab1299d..4b159b4eb 100644 --- a/src/fields/Document.ts +++ b/src/fields/Document.ts @@ -4,10 +4,8 @@ import { NumberField } from "./NumberField"; import { ObservableMap, computed, action, observable } from "mobx"; import { TextField } from "./TextField"; import { ListField } from "./ListField"; -import { findDOMNode } from "react-dom"; import { Server } from "../client/Server"; import { Types } from "../server/Message"; -import { ObjectID } from "bson"; export class Document extends Field { public fields: ObservableMap<string, { key: Key, field: Opt<Field> }> = new ObservableMap(); @@ -17,6 +15,8 @@ export class Document extends Field { super(id) if (save) { + var title = (this._proxies.has(KeyStore.Title.Id) ? "???" : this.Title) + "(" + this.Id + ")"; + console.log("Save " + title); Server.UpdateField(this) } } @@ -169,7 +169,9 @@ export class Document extends Field { throw new Error("Method not implemented."); } GetValue() { - throw new Error("Method not implemented."); + var title = (this._proxies.has(KeyStore.Title.Id) ? "???" : this.Title) + "(" + this.Id + ")"; + return title; + //throw new Error("Method not implemented."); } Copy(): Field { throw new Error("Method not implemented."); diff --git a/src/fields/ListField.ts b/src/fields/ListField.ts index 1585746df..d3d8fc71b 100644 --- a/src/fields/ListField.ts +++ b/src/fields/ListField.ts @@ -43,15 +43,17 @@ export class ListField<T extends Field> extends BasicField<T[]> { } init(callback: (field: Field) => any) { + console.log("requesting list fields " + this._proxies.length) Server.GetFields(this._proxies, action((fields: { [index: string]: Field }) => { if (!this.arraysEqual(this._proxies, this.Data.map(field => field.Id))) { - + console.log("Got new fields " + this.Data.length) this.Data = this._proxies.map(id => fields[id] as T) observe(this.Data, () => { this.updateProxies() Server.UpdateField(this); }) } + console.log("received fields " + this.Data) callback(this); })) } |
