Home > @jsplumbtoolkit/core > JsPlumbToolkit > addFactoryGroup
JsPlumbToolkit.addFactoryGroup() method
Adds a Group by type, running the data generation for the node through the current GroupFactory. This is different from addGroup
in that with addGroup
you are supplying the final data and your GroupFactory is not called. This method can be called with one, two or three arguments. A single argument is considered to be the new Group's type
, and a backing data object will be created with this set, and no callback will occur. If you provide two arguments the second argument may be either the new Group's backing data OR a callback to hit with the newly created Group. With three arguments the second argument is the Group's backing data and the third is a callback to hit with the newly created Group.
Signature:
addFactoryGroup(type: string, data?: ObjectData, continueCallback?: Function, abortCallback?: Function): void;
Parameters
Parameter | Type | Description |
---|---|---|
type | string | Required. Type of the object to create. type will be passed as the first argument to your group factory. |
data | ObjectData | Optional backing data for the Group. |
continueCallback | Function | Optional function to call with the newly created Group. |
abortCallback | Function | Optional function to call if the group factory aborted |
Returns:
void