Last active
January 28, 2018 02:55
-
-
Save beattyml1/4d685ed1603a2e6039d8394ce42e46b4 to your computer and use it in GitHub Desktop.
Record Editor Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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