Table of Contents:
- Dynamic schemas support
- Extensible and customizable
- No external libraries needed
- Multiple forms per document supported
Include the main library dependencies:
Optionally, include the bootstrap extension (requires bootstrap):
object representing the schema structure:
var schema = "type": "boolean"var BrutusinForms = brutusin"json-forms";var bf = BrutusinForms;
And finally render the form inside a container with optional preloaded JSON initial data,
var container = document;bf;
This library supports dynamic schemas, that is, subschemas that can change depending on the value of other parts of the data.
This lets creating dynamic forms that vary their shape depending on the values entered by the user. This is extremely useful for big autogenerated schemas, that aggregates lots of subschemas and have functional bindings, given that it allows to show the user a simpler, non-error-prone form, also avoiding asking for unneeded data.
Dynamic schemas are built upon two main blocks:
- Custom (non-standard) schema property called
dependsOn, to build the subschemas dependency graph
- Brutusin DSL for path expressions, for identifying subschemas.
dependsOn schema extension
Dynamic schema resolution
||BrutusinForms factory method|
||Register a callback function to be notified after an HTML element has been rendered (passed as parameter). See brutusin-json-forms-bootstrap.js for an example of bootstrap decorator.|
||Callback function to be notified after a BrutusinForms instance has been rendered (passed as parameter)|
||Array containing all the BrutusinForms instances created in the document by the factory method.|
||Renders the form inside the the container, with the specified data preloaded|
||Schema resolver for dynamic schemas|
Support bugs and requests
- Ignacio del Valle Alles (https://github.com/idelvall/)
Contributions are always welcome and greatly appreciated!
Apache License, Version 2.0