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
Configs
5The active child index.
The active child item.
Specifies whether to slide tabs in and out of visibility.
Properties
4
Properties
4Class hierarchy
Other
If the layout is set to animateCardChange, then this property
will be true during the animated card change.
Events
2
Events
2The active item has changed.
// Adding a listener using the "on" method
card.on('activeItemChange', ({ activeIndex, activeItem, prevActiveIndex, prevActiveItem, containedFocus }) => {
});| Parameter | Type | Description |
|---|---|---|
activeIndex | Number | The new active index. |
activeItem | Widget | The new active child widget. |
prevActiveIndex | Number | The previous active index. |
prevActiveItem | Widget | The previous active child widget. |
containedFocus | Boolean |
|
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 }) => {
});| Parameter | Type | Description |
|---|---|---|
activeIndex | Number | The new active index. |
activeItem | Widget | The new active child widget. |
prevActiveIndex | Number | The previous active index. |
prevActiveItem | Widget | The previous active child widget. |
containedFocus | Boolean |
|
Event handlers
2
Event handlers
2The active item has changed.
new Card({
onActiveItemChange({ activeIndex, activeItem, prevActiveIndex, prevActiveItem, containedFocus }) {
}
});| Parameter | Type | Description |
|---|---|---|
activeIndex | Number | The new active index. |
activeItem | Widget | The new active child widget. |
prevActiveIndex | Number | The previous active index. |
prevActiveItem | Widget | The previous active child widget. |
containedFocus | Boolean |
|
The active item is about to be changed. Return false to prevent this.
new Card({
onBeforeActiveItemChange({ activeIndex, activeItem, prevActiveIndex, prevActiveItem, containedFocus }) {
}
});| Parameter | Type | Description |
|---|---|---|
activeIndex | Number | The new active index. |
activeItem | Widget | The new active child widget. |
prevActiveIndex | Number | The previous active index. |
prevActiveItem | Widget | The previous active child widget. |
containedFocus | Boolean |
|