Constructor
new Formula(parent, optionsopt)
Creates an instance of Formula
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parent |
Element | String | The intended wrapper | |||||||||||||||||||||||||||||
options |
Object |
<optional> |
Optional additional parameters
Properties
|
- Source:
Methods
(static) destroy(selector)
Removes any Formula mutation from the DOM
Parameters:
Name | Type | Description |
---|---|---|
selector |
String | The selector for the Formula parent |
- Source:
add(formulaString) → {Formula}
Add to the Formula manually
Parameters:
Name | Type | Description |
---|---|---|
formulaString |
String | The Formula String |
- Source:
Returns:
The current Formula
- Type
- Formula
addField(fieldPath) → {Formula}
Add a custom field to the Formula manually
Parameters:
Name | Type | Description |
---|---|---|
fieldPath |
String | The field path |
- Source:
Returns:
The current Formula
- Type
- Formula
clear() → {Formula}
Clear the Formula manually
- Source:
Returns:
The current Formula
- Type
- Formula
destroy()
Removes any Formula mutation from the DOM
- Source:
get() → {String}
Get the String value of the Formula
- Source:
Returns:
The String representation of the Formula
- Type
- String
set(formulaString) → {Formula}
Set the Formula manually
Parameters:
Name | Type | Description |
---|---|---|
formulaString |
String | The Formula String |
- Source:
Returns:
The current Formula
- Type
- Formula
Type Definitions
Field
Field object
Properties:
Name | Type | Description |
---|---|---|
name |
String | The field's pretty name |
children |
Object.<String, Field> | Boolean | Either another level of Fields or a boolean (to use in combination of the 'onFieldExpand' callback) |
customData |
Object | Custom data for the field (Will be the 'onFieldExpand' callback second argument) |
- Source:
Example
{
name: 'Pretty name',
children: {
firstChild: {
name: 'Child name'
},
secondChild: {
name: 'Second child name',
children: true
}
}
}