Factory class for XO form - Used to create an XO form context. Provides factory methods. Starting point for using XO form.
Build {ExoFormContext} instance.
Generates meta documentation about all controls in the given control library.
Parameters | Type | Description |
---|---|---|
library | Object |
** |
return | Array |
- Array containing control metadata. |
Generates an XO form schema with all available controls
Parameters | Type | Description |
---|---|---|
return | Object |
- XO form schema |
Loads and parses an XO form schema from the given source
Parameters | Type | Description |
---|---|---|
value | * |
Object, string, URL |
options | * |
options |
return | ExoFormSchema | ** |
Determines the XO form schema type from an object.
Parameters | Type | Description |
---|---|---|
value | Object |
** |
return | String |
- the detected type ("field", "json-schema" or "form") |
Run a form directly and return generated container
Parameters | Type | Description |
---|---|---|
value | * |
JS/JSON schema or a URL to fetch it from. |
options | * |
*Object containing options |
- context: ExoFormContext
- on: object with event listeners e.g. xo.form.run(schema, { on: { post: e => { // handle post } } })
- for DOM event listening, use (on: {dom: {change: e => { ... }}})
xo.form.run(schema, {
on: {
post: e => {
// handle post
},
dom: {
change: e => {
// handle change event
}
}
}
})*
return |
undefined
| div element (form container element div.exf-container)
Read JSON Schema from the given URL.
Parameters | Type | Description |
---|---|---|
schemaUrl | URL |
The URL to read the JSON Schema from |
return | Object |
- JSON Schema Object |