Skip to main content

Common Data Types


Contact#

This type represents a contact

PropertyTypeDescriptionRequired?Default
namestringThe name of the contact, may be null.Yes
emailAddressstringThe email address of the contact.Yes

SimpleElementView#

Base view for many other views

Methods#

destroy()#

Removes the element and executes any necessary clean-up.

Events#

destroy#

Fires when the view is destroyed. This can be triggered by the app calling the destroy() method or by the InboxSDK internally calling the destroy() method.

Properties#

PropertyTypeDescriptionRequired?Default
elHTMLElementAn element that you should modify and fill with your app's content.Yes
destroyedbooleanThis property is set to true once the view is destroyed.Yes

DropdownView#

This class represents a Dropdown returned by the SDK to the app in various places. The dropdown can be filled with your apps content, but it automatically handles dismissing the dropdown on certain user actions.

Methods#

setPlacementOptions(options)#

This allows the position settings of the dropdown to be changed.

ParametersTypeDescription
optionsPositionOptions

close()#

Closes the dropdown

reposition()#

Causes the dropdown element to recalculate its position relative to its button anchor. Use this method if you've changed the height of the dropdown while it is displayed.

Events#

destroy#

Fires when this DropdownView instance is closed.

preautoclose#

Fires when this DropdownView instance is about to close itself in response to a user clicking outside of the dropdown or pressing escape. This event may be canceled in order to stop the dropdown from closing itself. You may want to do this if you have created a "subdropdown" menu from this dropdown that isn't part of this DropdownView's element, and you don't want clicks on your subdropdown to cause this DropdownView to auto-close.

Event propertiesTypeDescription
typestringThis will be "outsideInteraction" if the cause is a click or focus outside of the DropdownView, or "escape" if the cause is the user pressing the Escape key.
causeEventThis is the DOM event that is triggering the DropdownView to auto-close. If type is "outsideInteraction", then you may want to check if your your subdropdown element contains the cause.target element.
cancelfunctionCalling this method will prevent this DropdownView from closing itself.

Properties#

PropertyTypeDescriptionRequired?Default
elHTMLElementThe HTML element that is displayed in the dropdown.Yes
destroyedbooleanThis property is set to true once the view is destroyed.Yes

PositionOptions#

This object is used to control the positioning of an element (such as a drop-down menu) relative to an anchor element (the button that opened the drop-down menu). It is used by DropdownView.setPlacementOptions().

PropertyTypeDescriptionRequired?Default
positionstringThis value sets the prioritized position for the element relative to its anchor. It may be set to null, "top", "bottom", "left", or "right". The element will use this position unless it is not possible to do so while fitting the element on-screen.Nonull
forcePositionbooleanIf true, then the configured position value will be used even if it results in the element going off of the screen.Nofalse
hAlignstringThis value sets the prioritized horizontal alignment mode for the element relative to its anchor. The horizontal alignment mode is used if the element is positioned in the top or bottom positions relative to the anchor, and causes the element to be moved horizontally in order to make a specific edge align. It may be set to null, "center", "left", or "right". The element will use this alignment unless it is not possible to do so while fitting the element on-screen.Nonull
forceHAlignbooleanIf true, then the configured hAlign value will be used even if it results in the element going off of the screen.Nofalse
vAlignstringThis value sets the prioritized vertical alignment mode for the element relative to its anchor. The vertical alignment mode is used if the element is positioned in the left or right positions relative to the anchor, and causes the element to be moved vertically in order to make a specific edge align. It may be set to null, "center", "top", or "bottom". The element will use this alignment unless it is not possible to do so while fitting the element on-screen.Nonull
forceVAlignbooleanIf true, then the configured vAlign value will be used even if it results in the element going off of the screen.Nofalse
buffernumberThis property specifies a number of pixels to be used as a buffer zone around the element. For screen-fitting purposes, the element will be treated as if it was this much larger in all directions, requiring it to be placed with the given amount of space between it, the anchor element, and the edges of the screen. The buffer option is useful if the element has children which are positioned such that they escape the boundaries of the element. Buffers do not affect alignment with the anchor element.No0
topBuffernumberSee buffer property. This specifies an additional buffer space only for the top edge.No0
bottomBuffernumberSee buffer property. This specifies an additional buffer space only for the bottom edge.No0
leftBuffernumberSee buffer property. This specifies an additional buffer space only for the left edge.No0
rightBuffernumberSee buffer property. This specifies an additional buffer space only for the right edge.No0