aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Document.ts
diff options
context:
space:
mode:
authorlaurawilsonri <laura_wilson@brown.edu>2019-03-19 16:50:19 -0400
committerlaurawilsonri <laura_wilson@brown.edu>2019-03-19 16:50:19 -0400
commit7f65273917913d9e71fe73da66131888fb8d1020 (patch)
tree63da9ce79cc72752840c78a8ff6fae2f313ca1df /src/fields/Document.ts
parentf2fa6d6d28f2011a13f9034f5685b08301c291e4 (diff)
parent9eff1894078c0cbf5592646acb5e20e5761fc167 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into editableSchema
Diffstat (limited to 'src/fields/Document.ts')
-rw-r--r--src/fields/Document.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fields/Document.ts b/src/fields/Document.ts
index be0137128..b6439364a 100644
--- a/src/fields/Document.ts
+++ b/src/fields/Document.ts
@@ -249,6 +249,13 @@ export class Document extends Field {
}
@action
+ SetDataOnPrototype<T, U extends Field & { Data: T }>(key: Key, value: T, ctor: { new(): U }, replaceWrongType = true) {
+ this.GetAsync(KeyStore.Prototype, (f: Field) => {
+ (f as Document).SetData(key, value, ctor)
+ })
+ }
+
+ @action
SetData<T, U extends Field & { Data: T }>(key: Key, value: T, ctor: { new(): U }, replaceWrongType = true) {
let field = this.Get(key, true);