Carousel

A virtualized container of items that can be scrolled either horizontally or vertically. As scrolling occurs, a configured number of visible items (slots) are dynamically positioned and reconfigured to give the appearance that all items in the specified range are present.

To create a carousel, a configureSlot function must be provided that will return the configuration object for a given slot index. Slot index 0 is special, and whenever the range is not empty, 0 must be included in the range. The meaning of a slot index, however, is defined by the developer and only interpreted by the developer-provided configureSlot function.

Slot indexes are converted into virtual scroll positions and given to an InfinityScroller. This special scroller allows for negative scroll positioning as well as unbounded scroll range.

This widget is not intended to be used standalone, but as part of higher-level widgets such as MultiDatePicker.

Configs

120

Common

listenersEvents

Other

configureSlot: String | functionAlso a property

A callback function that must be provided by the developer to produce configuration objects for the slots in the carousel.

Derived classes may set this config to the name of the instance method to call. The this pointer will be the carousel instance.

ParameterTypeDescription
indexNumber

The slot index as defined by the range of the carousel.

carouselCarousel

The carousel instance.

slotWidget

The slot being reconfigured or null when creating a new slot.

Returns: ContainerItemConfig -

The slot's configuration object.

The first visible slot index. This first visible slot can be read or written using this property. Setting currentIndex will determine if the transition can be animated by the distance being traveled.

See goto.

disableReserveSlots: Boolean | inert= false

The value to set for the disabled config on reserve slots. These slots are not visible to the user but can be tabbed into from visible slots.

When set to 'inert', the inert DOM attribute is also set. This prevents tabbing from a visible slot to a reserved slot.

The HTML to render when the carousel's range is empty. To avoid XSS attacks, it is safer to use emptyText instead.

emptyText: String= No items to displayAlso a property

The text to render when the carousel's range is empty. This text is automatically encoded and is safe from XSS issues. To render markup when the carousel is empty, see emptyHtml.

The range of slot indexes to be presented in the carousel. Slot indexes greater than or equal to range[0] and less than range[1] will be rendered.

If this value is null or [0, 0], the carousel will render no items (i.e., it will be empty). See emptyText.

By default, the carousel's range is unlimited, i.e., range = [-Infinity, Infinity].

The number of slots to render beyond what is visible in the carousel. These reserve items are critical to giving the appearance of continuity as the carousel is being scrolled. A minimum of 1 is required and is generally sufficient for slots that are reasonably large. If slots are small (maybe less than 100px), it may be helpful to provide additional reserve slots.

Set to true to use trapFocus to scroll the carousel when tabbing to slots that are not currently visible.

NOTE: This only works when configureSlot produces Panel instances.

shrinkWrap: Boolean | auto= autoAlso a property

Due to the position: absolute nature of carousel items, a carousel does not have a natural size. When the carousel is being sized by its container, this is not a problem, but can be an issue if the carousel is being used in a layout where its natural size would be important.

Specify true for the carousel to provide a natural size based on the size of its slots. This is done by setting min-width and/or min-height on the internal elements that contain the absolutely positioned slots. This may have a modest performance impact due to the required measuring of the slots to provide these minimums.

By default (shrinkWrap = 'auto'), the carousel enables shrinkWrap support when the carousel's main element is position: absolute. This can be disabled by setting shrinkWrap = false.

The number of slots to present in the carousel. When set to a number, each slot is given a percentage size (e.g., "50%" for slots = 2) so they fill the carousel. This is typically required when the carousel is using shrinkWrap (note: shrink wrapping is enabled by default for position: absolute carousels).

When null, as many slots as needed to fill the carousel are created. This can produce partially visible slots.

Setting this value to 'auto' will similarly fill the available space, but once the required number of slots is determined, they are assigned a percentage size so that they completely fill the carousel.

snap: Boolean= trueAlso a property

Set to false to disable scroll snapping and allow free scrolling through the carousel.

vertical: Boolean= falseAlso a property

Set to true to enable vertical mode. By default, carousels scroll horizontally.

columnWidget
defaultFocusContainer
drawerPanel
labelPositionContainer
renditionContainer
rtlRTL
spanWidget

Accessibility

ariaLabelWidget
keyMapKeyMap

Content

bbarPanel
defaultsContainer
footerPanel
headerPanel
itemsContainer
lazyItemsContainer
namedItemsContainer
stripsPanel
tbarPanel
textContentContainer
toolsPanel

CSS

bodyClsPanel
borderContainer
clsWidget
colorWidget
htmlClsWidget
itemClsContainer
styleWidget
uiPanel

DOM

adoptWidget
appendToWidget
contentWidget
datasetWidget
htmlWidget
idWidget
tagWidget

Float & align

alignWidget
anchorWidget
centeredWidget
draggableWidget
floatingWidget
xWidget
yWidget

Layout

alignSelfWidget
dockWidget
flexWidget
heightWidget
hiddenWidget
hideWhenEmptyContainer
layoutContainer
layoutStyleContainer
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
textAlignWidget
weightWidget
widthWidget

misc

tabBarItemsContainer

Misc

dataFieldWidget
disabledWidget
iconPanel
localeClassLocalizable
localizableLocalizable
maskedWidget
ownerWidget
readOnlyWidget
refWidget
rippleWidget
tabWidget
titlePanel
tooltipWidget

Record

recordContainer

Scrolling

State

stateIdState

Properties

106

Class hierarchy

isCarousel: Boolean= truereadonly
Identifies an object as an instance of Carousel class, or subclass thereof.
isCarousel: Boolean= truereadonlystatic
Identifies an object as an instance of Carousel class, or subclass thereof.
isContainerContainer
isDelayableDelayable
isEventsEvents
isKeyMapKeyMap
isLocalizableLocalizable
isPanelPanel
isStateState
isToolableToolable
isWidgetWidget

Other

configureSlot: String | functionAlso a config

A callback function that must be provided by the developer to produce configuration objects for the slots in the carousel.

Derived classes may set this config to the name of the instance method to call. The this pointer will be the carousel instance.

ParameterTypeDescription
indexNumber

The slot index as defined by the range of the carousel.

carouselCarousel

The carousel instance.

slotWidget

The slot being reconfigured or null when creating a new slot.

Returns: ContainerItemConfig -

The slot's configuration object.

The first visible slot index. This first visible slot can be read or written using this property. Setting currentIndex will determine if the transition can be animated by the distance being traveled.

See goto.

The HTML to render when the carousel's range is empty. To avoid XSS attacks, it is safer to use emptyText instead.

emptyText: String= No items to displayAlso a config

The text to render when the carousel's range is empty. This text is automatically encoded and is safe from XSS issues. To render markup when the carousel is empty, see emptyHtml.

The range of slot indexes to be presented in the carousel. Slot indexes greater than or equal to range[0] and less than range[1] will be rendered.

If this value is null or [0, 0], the carousel will render no items (i.e., it will be empty). See emptyText.

By default, the carousel's range is unlimited, i.e., range = [-Infinity, Infinity].

The number of slots to render beyond what is visible in the carousel. These reserve items are critical to giving the appearance of continuity as the carousel is being scrolled. A minimum of 1 is required and is generally sufficient for slots that are reasonably large. If slots are small (maybe less than 100px), it may be helpful to provide additional reserve slots.

scrolling: Booleanreadonly

This will yield true when the carousel is currently scrolling.

scrollOnTab: Boolean= falseAlso a config

Set to true to use trapFocus to scroll the carousel when tabbing to slots that are not currently visible.

NOTE: This only works when configureSlot produces Panel instances.

shrinkWrap: Boolean | auto= autoAlso a config

Due to the position: absolute nature of carousel items, a carousel does not have a natural size. When the carousel is being sized by its container, this is not a problem, but can be an issue if the carousel is being used in a layout where its natural size would be important.

Specify true for the carousel to provide a natural size based on the size of its slots. This is done by setting min-width and/or min-height on the internal elements that contain the absolutely positioned slots. This may have a modest performance impact due to the required measuring of the slots to provide these minimums.

By default (shrinkWrap = 'auto'), the carousel enables shrinkWrap support when the carousel's main element is position: absolute. This can be disabled by setting shrinkWrap = false.

The number of slots to present in the carousel. When set to a number, each slot is given a percentage size (e.g., "50%" for slots = 2) so they fill the carousel. This is typically required when the carousel is using shrinkWrap (note: shrink wrapping is enabled by default for position: absolute carousels).

When null, as many slots as needed to fill the carousel are created. This can produce partially visible slots.

Setting this value to 'auto' will similarly fill the available space, but once the required number of slots is determined, they are assigned a percentage size so that they completely fill the carousel.

snap: Boolean= trueAlso a config

Set to false to disable scroll snapping and allow free scrolling through the carousel.

vertical: Boolean= falseAlso a config

Set to true to enable vertical mode. By default, carousels scroll horizontally.

$namestaticWidget
columnWidget
firstItemContainer
hasChangesContainer
isValidContainer
itemsContainer
labelPositionContainer
lastItemContainer
renditionContainer
rtlRTL
spanWidget
toolsPanel
typestaticWidget
valuesContainer

Accessibility

keyMapKeyMap

Content

bbarPanel
tbarPanel

CSS

clsWidget

DOM

appendToWidget
contentWidget
datasetWidget
elementWidget
htmlWidget
idWidget
styleWidget

Float & align

xWidget
yWidget

Layout

alignSelfWidget
flexWidget
heightWidget
layoutContainer
layoutStyleContainer
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
widthWidget

Lifecycle

configBase

Misc

cellInfoWidget
disabledWidget
localeHelperLocalizable
localeManagerLocalizable
readOnlyWidget
refWidget
tabWidget
titlePanel
tooltipWidget

Record

recordContainer

State

stateState

Visibility

hiddenWidget
isVisibleWidget

Widget hierarchy

ownerWidget
parentWidget
widgetMapContainer

Functions

81

Other

Step the carousel back one slot index.

ParameterTypeDescription
animateBoolean

Pass false to disable smooth scrolling animation. Animations can only be disabled with this parameter, not enabled. For more details, see go

Ensures that the given slot index is visible, scrolling if necessary to make it so.

ParameterTypeDescription
optionsObject

Options to configure which slot should be visible and how to scroll if necessary.

options.indexNumber

The index of the slot.

options.animateBoolean

Pass false to disable scroll animation.

Step the carousel forward one slot index. See go.

ParameterTypeDescription
animateBoolean

Pass false to disable smooth scrolling animation. Animations can only be disabled with this parameter, not enabled. For more details, see go

Steps the slot index of the carousel forward or backward by the given increment.

ParameterTypeDescription
incrementNumber

The number of slot indexes to advance forward (> 0) or backward (< 0).

animateBoolean

Pass false to disable smooth scrolling animation. Animations can only be disabled with this parameter, not enabled. For more details, see goto

Sets the slot index of the carousel to the given index.

ParameterTypeDescription
indexNumber

The new slot index for the carousel.

animateBoolean

Pass false to disable smooth scrolling animation. Animations can only be disabled with this parameter, not enabled. Animations are always disabled if animate is set to false. Further, if the slot index is changing by a large enough amount, animations will be also disabled. In other words, smooth scroll animation will be used as long as none of these conditions occur.

Returns the carousel slot index given a logical scroll position (see InfinityScroller).

ParameterTypeDescription
posNumber

The logical scroll position from the main InfinityAxis.

Returns: Number

Returns the logical scroll position (see InfinityScroller) given a carousel slot index.

ParameterTypeDescription
indexNumber

The carousel slot index.

Returns: Number
addContainer
composeWidget
createOnFrameDelayable
disableWidget
enableWidget
focusWidget
getAtContainer
getWidgetByIdContainer
insertContainer
LstaticLocalizable
maskWidget
onEvents
recomposeWidget
relayAllEvents
removeContainer
removeAllContainer
resetValuesContainer
setValuesContainer
triggerEvents
unEvents
unmaskWidget

Configuration

applyDefaultsstaticBase

Events

Float & align

alignToWidget
setXYWidget
showByWidget
toFrontWidget

Lifecycle

createstaticWidget
destroystaticBase
initClassstaticWidget

Misc

attachTooltipstaticWidget
fromElementstaticWidget
fromSelectorstaticWidget
getByIdstaticWidget
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

State

Visibility

hideWidget
showWidget

Widget hierarchy

closestWidget
containsWidget
ownsWidget
queryWidget
queryAllWidget
upWidget

Events

21

Event handlers

21

Typedefs

7

CSS variables

52

Inherited