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
options
Object Options for the class
The crossOrigin property - enables cross origin fetch
uri
crossOrigin
boolean The crossOrigin property
The URI property
uri
uri
string The URI property
The model property
uri
model
Model The model property
The initialized property
uri
isInitalized
boolean The initialized property
The title property
uri
title
string The title of the form
The name property
uri
name
string The name of the form
The description property
uri
description
string The description of the form
uri
display
array Fields to display - null will display all
uri
nestedInput
boolean Sets the input field as a chile of the label (defaults to false)
uri
submitButton
string The name of the submit button (defaults to null)
uri
resetButton
string The name of the reset button (defaults to null)
uri
legacy
boolean set legacy rendering
Sets the URI
uri
string The URI
Meta
- deprecated: Use property
Sets the schema
schema
object The JSON schema of the dataset
Enable/Disable the progress bar
show
boolean Show or Hide the progress bar
Show a message related to the form
message
string 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
data
object Data to fill in
Returns object Returns the view context ('this')
Remove the form and all binds
name
string Name of the formdescription
string A descriptionfields
object Object of fields with types (see JSON scheme properties format)model
object Data for the fields by keyrequired
array Array of requires fieldsbinding
string Name of the binding functiondisplay
array Array of fields to displaynestedInput
Dom Dom tree of nested markupsubmitButton
string Name of the Submit buttonresetButton
string Name of the reset buttonstyle
string Name of stylestagName
string Name of taglegacy
boolean Set old markup style (optional, defaultfalse
)large
(optional, defaultfalse
)submitPrimary
boolean Set submit to primary (optional, defaulttrue
)
Returns Dom Dom tree of form elements