Skip to content

Instantly share code, notes, and snippets.

@beattyml1
Last active January 28, 2018 02:55
Show Gist options
  • Save beattyml1/4d685ed1603a2e6039d8394ce42e46b4 to your computer and use it in GitHub Desktop.
Save beattyml1/4d685ed1603a2e6039d8394ce42e46b4 to your computer and use it in GitHub Desktop.
Record Editor Example
@editorFor("record", FieldSet, {isDefault: true})
export class RecordEditor extends BaseEditorModel<{[key:string]:any}, RecordSchemaType, BaseEditorModel<RecordSchemaType>, void> {
render() {
let recordType = this.props.field.typeParameters.typeParams as SchemaRecordType;
let fields = recordType.fields;
return (<>{
fields.map(field =>
<FieldEditor value={this.props.value[field.name]} field={field} context={createContext(field, this.props.context)}/>
)}
</>)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment