From bec89018d0ee73a8abaa5e01f2262bd95bc687f7 Mon Sep 17 00:00:00 2001 From: bob Date: Thu, 17 Jan 2019 16:56:03 -0500 Subject: added collectionfreeformview --- src/documents/Documents.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/documents/Documents.ts') diff --git a/src/documents/Documents.ts b/src/documents/Documents.ts index 20d4596fd..bba678bbd 100644 --- a/src/documents/Documents.ts +++ b/src/documents/Documents.ts @@ -68,4 +68,25 @@ export namespace Documents { doc.SetField(KeyStore.Data, new TextField(url)); return doc; } + + let collectionProto:Document; + function GetCollectionPrototype(): Document { + if(!collectionProto) { + collectionProto = new Document(); + collectionProto.SetField(KeyStore.X, new NumberField(150)); + collectionProto.SetField(KeyStore.Y, new NumberField(0)); + collectionProto.SetField(KeyStore.Width, new NumberField(300)); + collectionProto.SetField(KeyStore.Height, new NumberField(300)); + collectionProto.SetField(KeyStore.Layout, new TextField('')); + collectionProto.SetField(KeyStore.LayoutKeys, new ListField([KeyStore.Data])); + } + return collectionProto; + } + + export function CollectionDocument( documents: Array, options:DocumentOptions = {}): Document { + let doc = GetCollectionPrototype().MakeDelegate(); + setupOptions(doc, options); + doc.SetField(KeyStore.Data, new ListField(documents)); + return doc; + } } \ No newline at end of file -- cgit v1.2.3-70-g09d2