Augmented.js Presentation Automatic Form View Module
- AutomaticForm
- formCompile
Extends DecoratorView
A automatic form view created from a JSON Schema
Supported options:
- schema - The JSON Schema for use with the UI and validation
- data - prepopulate the model data
- crossOrigin - Set CORS for the fetch
- uri - the uri to fetch data from
- title - the title of the form
- description - set a tooltip for the form
- display - Array of fields to display (others are hidden)
- nestedInput - label wraps the input
- submitButton - set the name of the submit button (binds to a submit method)
- submitPrimary - set the submit button to primary (default)
- resetButton - set the name of the reset button (binds to a reset method)
- legacy - set legacy rendering (older look and feel)
- large - render large input fields
optionsObject Options for the class
The crossOrigin property - enables cross origin fetch
uri
crossOriginboolean The crossOrigin property
The URI property
uri
uristring The URI property
The model property
uri
modelModel The model property
The initialized property
uri
isInitalizedboolean The initialized property
The title property
uri
titlestring The title of the form
The name property
uri
namestring The name of the form
The description property
uri
descriptionstring The description of the form
uri
displayarray Fields to display - null will display all
uri
nestedInputboolean Sets the input field as a chile of the label (defaults to false)
uri
submitButtonstring The name of the submit button (defaults to null)
uri
resetButtonstring The name of the reset button (defaults to null)
uri
legacyboolean set legacy rendering
Sets the URI
uristring The URI
Meta
- deprecated: Use property
Sets the schema
schemaobject The JSON schema of the dataset
Enable/Disable the progress bar
showboolean Show or Hide the progress bar
Show a message related to the form
messagestring Some message to display
Validate the form
Returns boolean Returns true on success of validation
Is the form valid
Returns boolean Returns true if valid
Render the form
Returns object Returns the view context ('this')
Reset the form
Returns object Returns the view context ('this')
Populate the form
dataobject Data to fill in
Returns object Returns the view context ('this')
Remove the form and all binds
namestring Name of the formdescriptionstring A descriptionfieldsobject Object of fields with types (see JSON scheme properties format)modelobject Data for the fields by keyrequiredarray Array of requires fieldsbindingstring Name of the binding functiondisplayarray Array of fields to displaynestedInputDom Dom tree of nested markupsubmitButtonstring Name of the Submit buttonresetButtonstring Name of the reset buttonstylestring Name of stylestagNamestring Name of taglegacyboolean Set old markup style (optional, defaultfalse)large(optional, defaultfalse)submitPrimaryboolean Set submit to primary (optional, defaulttrue)
Returns Dom Dom tree of form elements