diff options
| author | bobzel <zzzman@gmail.com> | 2019-09-20 15:11:30 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2019-09-20 15:11:30 -0400 |
| commit | 6f7936d5c71bf3c802d73f47b19abe96c6d61848 (patch) | |
| tree | 266d2f5f47bdde960656a5a14888b7bba09fac62 /src/client/views/collections/CollectionSchemaCells.tsx | |
| parent | 2a003f69f8b5323c2a6b244332b1511df1ef0cc1 (diff) | |
simplified script execution api a little. fixed dataDoc() related stuff in various Box's. fixed some template stuff.
Diffstat (limited to 'src/client/views/collections/CollectionSchemaCells.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionSchemaCells.tsx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx index 0306d415c..4dac27e60 100644 --- a/src/client/views/collections/CollectionSchemaCells.tsx +++ b/src/client/views/collections/CollectionSchemaCells.tsx @@ -238,13 +238,11 @@ export class CollectionSchemaCell extends React.Component<CellProps> { return this.applyToDoc(props.Document, this.props.row, this.props.col, script.run); }} OnFillDown={async (value: string) => { - let script = CompileScript(value, { requiredType: type, addReturn: true, params: { this: Doc.name, $r: "number", $c: "number", $: "any" } }); - if (!script.compiled) { - return; + const script = CompileScript(value, { requiredType: type, addReturn: true, params: { this: Doc.name, $r: "number", $c: "number", $: "any" } }); + if (script.compiled) { + DocListCast(this.props.Document[this.props.fieldKey]). + forEach((doc, i) => this.applyToDoc(doc, i, this.props.col, script.run)); } - const run = script.run; - const val = await DocListCastAsync(this.props.Document[this.props.fieldKey]); - val && val.forEach((doc, i) => this.applyToDoc(doc, i, this.props.col, run)); }} /> </div > |
