Members
Object
# schema
The schema of the current field (schema of fields such as ‘Single Line Textbox’, ‘Number’,
and so on) is set using this method.
# uid
Methods
# getData(options) → {Object|string|number}
Gets the data of the current field
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Object
|
Options object for get Data method. |
resolved |
boolean
|
If the resolved parameter is set to true for the File field, then the method will return a resolved asset object along with all the field metadata, e.g. 'field.getData({resolved:true})'. |
Returns the field data.
Object
|
string
|
number
# onChange(callback)
This function is called when another extension programmatically changes data of this field using field.setData() function, only available for extension field, only support extensions of data type text, number, boolean or date.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function
|
The function to be called when an entry is published. |
# setData(data) → {external:Promise}
Sets the data for the current field.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object
|
string
|
number
|
Data to be set on the field |
A promise object which is resolved when data is set for a field. Note: The data set by this function will only be saved when user saves the entry.
external:Promise
# setFocus() → {Object}
Sets the focus for a field when an extension is being used. This method shows user presence and highlights the extension field that the user is currently accessing in Contentstack UI.
A promise object which is resolved when Contentstack UI returns an acknowledgement of the focused state.
Object