Constructor
# new BaseProperty(options)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
object
|
|||
path |
string
|
property path: usually it its key but when property is for an object the path can be divided to parts by dots: i.e. 'address.street' |
||
type |
PropertyType
|
<optional> |
'string' | |
isId |
boolean
|
<optional> |
false | true when field should be treated as an ID |
isSortable |
boolean
|
<optional> |
true | if property should be sortable |
Classes
Methods
# availableValues() → {Array.<String>|null}
Returns all available values which field can accept. It is used in case of
enums
array of all available values or null when field is not an enum.
Array.<String>
|
null
# isDraggable() → {boolean}
Returns true when given property has draggable elements.
Only usable for array properties.
boolean
# reference() → {string|null}
If property is a reference to a record of different resource
it should contain BaseResource.id of this resource.
When property is responsible for the field: 'user_id' in SQL database
reference should be the name of the Resource which it refers to: Users
string
|
null
# subProperties() → {Array.<BaseProperty>}
In case of `mixed` type returns all nested properties.
sub properties
Array.<BaseProperty>
# type() → {PropertyType}
Return type of a property
Type Definitions
object
# PropertyType
Properties:
Name | Type | Description |
---|---|---|
string |
string
|
default property type |
float |
string
|
type of floating point numbers |
number |
string
|
regular number |
boolean |
string
|
boolean value |
date |
string
|
date |
datetime |
string
|
date with time |
mixed |
string
|
type representing an object |
reference |
string
|
many to one reference |
richtext |
string
|
wysiwig editor |
textarea |
string
|
resizable textarea input |
password |
string
|
password field |