Home Reference Source
import {Manager} from './gui/core/Manager.jsx'
public class | source

Manager

Extends:

gui/data-items/DataItemContainer.js~DataItemContainer → Manager

The Manager provides methods to access and interact with widgets and data items. It is available globally: window.Alteryx.Gui.Manager.

Constructor Summary

Public Constructor
public

Constructor

Member Summary

Public Members
public

addWidget(tag: object): promise: *

Adds a widget to the manager.

Method Summary

Public Methods
public

bindDataItemToWidget(dataItem: DataItem, widgetId: string)

Binds a data item to a widget.

public

deleteProp(widgetId: string, prop: string)

Deletes a property from a widget.

public

getProp(widgetId: string, prop: string): *

Returns the value of a widget property.

public

removeWidget(widgetId: string, removeTag: boolean)

Removes a widget from the manager.

public

setProp(widgetId: string, prop: string, value: *)

Sets a property of a widget.

public

setProps(widgetId: string, props: object)

Sets multiple properties of a widget.

public

unbindDataItemFromWidget(dataItem: DataItem, widgetId: string)

Unbinds a data item from a widget.

Public Constructors

public constructor(args: Object) source

Constructor

Params:

NameTypeAttributeDescription
args Object
  • optional

The manager's configuration object

args.MacroMode boolean
  • optional
  • default: false

If the value of data items will be saved in macro mode format ({'Value': result.DataItem}). Note: the property name is PascalCase not camelCase

args.MetaInfo Array
  • optional
  • default: []

] An array of JSON objects that describes the incoming field data. Note: the property name is PascalCase not camelCase.

args.AllowCdata boolean
  • optional

Allows values of data items to be stored in a CDATA section (i.e. <![CDATA[...]]>). Note: the property name is PascalCase not camelCase.

Public Members

public addWidget(tag: object): promise: * source

Adds a widget to the manager.

Return:

promise

Promise which resolves after successfully adding the widget, and any child widgets.

Public Methods

public bindDataItemToWidget(dataItem: DataItem, widgetId: string) source

Binds a data item to a widget.

Params:

NameTypeAttributeDescription
dataItem DataItem

The data item to bind.

widgetId string

The id of the widget to bind.

public deleteProp(widgetId: string, prop: string) source

Deletes a property from a widget.

Params:

NameTypeAttributeDescription
widgetId string

The id of the widget to update.

prop string

The name of the prop.

public getProp(widgetId: string, prop: string): * source

Returns the value of a widget property.

Params:

NameTypeAttributeDescription
widgetId string

The id of the widget to update.

prop string

The name of the prop.

Return:

*

The value of the prop.

public removeWidget(widgetId: string, removeTag: boolean) source

Removes a widget from the manager.

Params:

NameTypeAttributeDescription
widgetId string

The id of the widget to remove.

removeTag boolean
  • optional
  • default: true

Specifies if the widget's html tag should be removed from the DOM.

public setProp(widgetId: string, prop: string, value: *) source

Sets a property of a widget.

Params:

NameTypeAttributeDescription
widgetId string

The id of the widget to update.

prop string

The name of the prop.

value *

The value of the prop.

public setProps(widgetId: string, props: object) source

Sets multiple properties of a widget.

Params:

NameTypeAttributeDescription
widgetId string

The id of the widget to update.

props object

The object with the name and value of the props.

public unbindDataItemFromWidget(dataItem: DataItem, widgetId: string) source

Unbinds a data item from a widget.

Params:

NameTypeAttributeDescription
dataItem DataItem

The data item to unbind.

widgetId string

The id of the widget to unbind.