Element Factory
Introduction
ElementFactory is the API exposed by Dynamo for creating Dynamo Elements. It's use is abstracted in the createElement
library.
Element Factory Overview
The ElementFactory object is exposed to the processor's context and is accessible using -
this.elementFactory;
The ElementFactory object has two methods
this.elementFactory.get(ElementOpts);
and
// this internally calls the .get method
this.elementFactory.getAll(this, [ElementOpts]);
The get method returns a single Dynamo Element on which you can call either the describeSync or the describe method of the element. Example usage -
this.elementFactory.get(ElementOpts).describeSync();
Element Properties
Property Name | Type | Description |
---|---|---|
name | String | The name of the element. This is the name with which the element value will be accessed in the form arguments. |
elementType | String | One of the valid element types that have been defined in dynamo constants. |
label | String | The label/ placeholder associated with the element |
description | String? | The description for the element if needed |
args | Object | The element specific options, it is usually different for various elements |
asyncValidators | Array? | An array of async functions that would be run to perform some validation on the element |
validators | Array? | An array of synchronous validators that will be run to validate the elements value. Includes the validators found in forms and elements. |
uid | String | The unique ID for the element |
order | Number | Display order on the form for the element. Determines the position of the element on the form |
component_uid | String|UUID | Globally unique ID for the element |