new Base(name, options)
Base class for fields
Parameters:
Name | Type | Description |
---|---|---|
name |
String | field name |
options |
FieldOption | field options |
Methods
-
getAttributes() → {Ojbect}
-
Normalise attributes
Returns:
- Type
- Ojbect
-
getData() → {*}
-
Returns:
- Type
- *
-
processData()
-
renderAttributes(attrs) → {String}
-
Render attribute string
Parameters:
Name Type Description attrs
Returns:
- Type
- String
-
setData(data)
-
Parameters:
Name Type Description data
-
toHTML() → {string}
-
Returns:
- Type
- string
-
toJSON() → {Object}
-
Returns:
- Type
- Object
-
toString() → {String}
-
Returns:
- Type
- String
-
validate(callback)
-
Execute all validators on the field data.
Parameters:
Name Type Description callback
function -
validateSync() → {*|Boolean}
-
Validate a field synchronously will not work if one of the validators is async.
Returns:
- Type
- * | Boolean