foundation-layout.foundationlayout.additem
Home > @genesislcap/foundation-layout > FoundationLayout > addItem
FoundationLayout.addItem() method
Dynamically add a new item to the layout. The user can move the new plane to whenever they want once it has been added.
Signature:
addItem(config: RegisteredElementConfig | RegisteredElementConfig[], placement?: Placement): void;
Parameters
Parameter | Type | Description |
---|---|---|
config | RegisteredElementConfig | RegisteredElementConfig[] | RegisteredElementConfig configuration items for the new items(s). Pass an array of RegisteredElementConfig to add multiple items at once. |
placement | Placement | (Optional) where and how to add the new items to the layout. For more info and defaults see Placement. |
Returns:
void
Exceptions
LayoutRegistrationError if you attempt to add an item before it has been registered
Remarks
Adding new items invokes the registration previously made explicitly via registerItem() or implicitly via the html declarative API.
The elements added onto the new pane are copies using element.cloneNode()
of the original element references used during registration.