Card

A helper class for containers which must manage multiple child widgets, of which only one may be visible at once such as a TabPanel. This class offers an active widget switching API, and optional slide-in, slide-out animations from child to child.

Configs

5
activeIndex: Number

The active child index.

The active child item.

animateCardChange: Boolean= true

Specifies whether to slide tabs in and out of visibility.

itemClsLayout

Properties

4

Class hierarchy

isCard: Boolean= truereadonly
Identifies an object as an instance of Card class, or subclass thereof.
isCard: Boolean= truereadonlystatic
Identifies an object as an instance of Card class, or subclass thereof.

Other

isChangingCard: Booleanreadonly

If the layout is set to animateCardChange, then this property will be true during the animated card change.

ownerLayout

Events

2

The active item has changed.

// Adding a listener using the "on" method
card.on('activeItemChange', ({ activeIndex, activeItem, prevActiveIndex, prevActiveItem, containedFocus }) => {

});
ParameterTypeDescription
activeIndexNumber

The new active index.

activeItemWidget

The new active child widget.

prevActiveIndexNumber

The previous active index.

prevActiveItemWidget

The previous active child widget.

containedFocusBoolean

true if the outgoing item contained focus.

The active item is about to be changed. Return false to prevent this.

// Adding a listener using the "on" method
card.on('beforeActiveItemChange', ({ activeIndex, activeItem, prevActiveIndex, prevActiveItem, containedFocus }) => {

});
ParameterTypeDescription
activeIndexNumber

The new active index.

activeItemWidget

The new active child widget.

prevActiveIndexNumber

The previous active index.

prevActiveItemWidget

The previous active child widget.

containedFocusBoolean

true if the outgoing item contains focus.

Event handlers

2

The active item has changed.

new Card({
    onActiveItemChange({ activeIndex, activeItem, prevActiveIndex, prevActiveItem, containedFocus }) {

    }
});
ParameterTypeDescription
activeIndexNumber

The new active index.

activeItemWidget

The new active child widget.

prevActiveIndexNumber

The previous active index.

prevActiveItemWidget

The previous active child widget.

containedFocusBoolean

true if the outgoing item contained focus.

The active item is about to be changed. Return false to prevent this.

new Card({
    onBeforeActiveItemChange({ activeIndex, activeItem, prevActiveIndex, prevActiveItem, containedFocus }) {

    }
});
ParameterTypeDescription
activeIndexNumber

The new active index.

activeItemWidget

The new active child widget.

prevActiveIndexNumber

The previous active index.

prevActiveItemWidget

The previous active child widget.

containedFocusBoolean

true if the outgoing item contains focus.