model view remove and insert components (#2351)

* added the ability to remove a component from a container to insert it to a position
This commit is contained in:
Leila Lali
2018-08-31 13:08:27 -07:00
committed by GitHub
parent 8e0c19fc8d
commit b27f69aace
25 changed files with 453 additions and 94 deletions

View File

@@ -119,6 +119,20 @@ declare module 'sqlops' {
* @param {*} [itemLayout] Optional layout for this child item
*/
addFormItem(formComponent: FormComponent | FormComponentGroup, itemLayout?: FormItemLayout): void;
/**
* Inserts a from component in a given position in the form. Returns error given invalid index
* @param formComponent Form component
* @param index index to insert the component to
* @param itemLayout Item Layout
*/
insertFormItem(formComponent: FormComponent | FormComponentGroup, index?: number, itemLayout?: FormItemLayout);
/**
* Removes a from item from the from
* @param formComponent
*/
removeFormItem(formComponent: FormComponent | FormComponentGroup): boolean;
}
export interface Component {
@@ -201,12 +215,28 @@ declare module 'sqlops' {
/**
* Creates a child component and adds it to this container.
* Adding component to multiple containers is not supported
*
* @param {Component} component the component to be added
* @param {*} [itemLayout] Optional layout for this child item
*/
addItem(component: Component, itemLayout?: TItemLayout): void;
/**
* Creates a child component and inserts it to this container. Returns error given invalid index
* Adding component to multiple containers is not supported
* @param component the component to be added
* @param index the index to insert the component to
* @param {*} [itemLayout] Optional layout for this child item
*/
insertItem(component: Component, index: number, itemLayout?: TItemLayout): void;
/**
*
* @param component Removes a component from this container
*/
removeItem(component: Component): boolean;
/**
* Defines the layout for this container
*