Check out on gitHub, see the example on Demo page, see the document, extension.

Mainly, there are three parts consist of Javascript part:

form,  schema  and model.

Schema :


I like define the schema first. Usually you will use two props:

typeproperties & required.

{
"type": "object",
"title": "Somehting ele",
"properties": {
"email": {
"title": "Email",
"type": "string",
"pattern": "^\\S+@\\S+$",
"description": "Email will be used for evil."
}
},
"required": [
"email"
]
}

In 'properties', is the place where you define the form elements. For example - "email".

Form:


Then in the form, if you thing the schema setting is ok, then in form:

[
"email"
]

Also you can overwrite the form: for example,  I want to over the title, add a placeholder.

{
"key": "email",
"type": "string",
"title": "Email filed",
"placeholder": "Email"
}

"key" in the example matchs to the "email" in the shcema.

A good example for input field:

Schema:

"email": {
"title": "Email",
"type": "string",
"pattern": "^\\S+@\\S+$",
"maxlength": 120,
"minlength": 3,
"validationMessage": "This is not an email"
"description": "Email will be used for evil."
}

Form:

  {
"key": "email",
"type": "string",
"title": "Email filed",
"placeholder": "Email"
}

Standard Options for form:

{
key: "address.street", // The dot notatin to the attribute on the model
type: "text", // Type of field
title: "Street", // Title of field, taken from schema if available
notitle: false, // Set to true to hide title
description: "Street name", // A description, taken from schema if available, can be HTML
validationMessage: "Oh noes, please write a proper address", // A custom validation error message
onChange: "valueChanged(form.key,modelValue)", // onChange event handler, expression or function
feedback: false, // Inline feedback icons
placeholder: "Input...", // placeholder on inputs and textarea
ngModelOptions: { ... }, // Passed along to ng-model-options
readonly: true, // Same effect as readOnly in schema. Put on a fieldset or array
// and their items will inherit it.
htmlClass: "street foobar", // CSS Class(es) to be added to the container div
fieldHtmlClass: "street" // CSS Class(es) to be added to field input (or similar)
}

最新文章

  1. Window下Qt Creator启动错误解决方法
  2. wpf 查找页面的所有TextBox
  3. Python核心编程--学习笔记--2--Python起步(下)
  4. CodeForces Round #278 (Div.2) (待续)
  5. 【转】placement new
  6. Learning LexRank——Graph-based Centrality as Salience in Text Summarization(一)
  7. 寻找子串位置 codevs 1204
  8. ZendFramework 两种安装方式
  9. JDBC的使用——Statement
  10. C++ 中mallon动态分配内存大小用法
  11. Recover Polygon (easy)
  12. ng-file-upload(在单文件选择,并且通过点击“上传”按钮上传文件的情况下,如何在真正选择文件之前保留上一文件信息?)
  13. zookeeper分布式搭建
  14. Oracle 存储过程笔记.
  15. springboot-菜鸟学习1
  16. PAT基础6-4
  17. Django中URL有关
  18. svn错误:Can't convert string from 'UTF-8' to native encoding
  19. 解决IE6中 PNG图片透明的终极方案-八种方案!
  20. 【android】开源一个企业通讯录app

热门文章

  1. Unity3D中使用3DMAX建模规范
  2. 使用Amoeba 实现MySQL DB 读写分离
  3. Welcome to Linux From Scratch!
  4. jquery页面无刷新切换皮肤并保存
  5. 刷票 变 IP
  6. 设计模式_Mediator_调停者模式
  7. js中的继承2--原型继承
  8. 用JSP做后台管理系统
  9. JDBCTemplate.java
  10. 对Map按key和value分别排序