CursorAPIMixin

Exposes a public API for navigating a cursor over a set of items

Overview

This mixin expects a component to provide an items Array of all elements in the list. This mixin also expects the component to apply ItemsCursorMixin or otherwise define a compatible currentIndex state and other state members for navigating the current item.

Given the above, this mixin exposes a consistent public API for reading and manipulating the cursor.

API

Used by classes AutoCompleteComboBox, Carousel, CarouselSlideshow, CarouselWithThumbnails, CenteredStrip, CrossfadeStage, CrossfadeStage, DropdownList, Explorer, FilterComboBox, FilterListBox, ListBox, ListComboBox, ListExplorer, ListWithSearch, Menu, Modes, MultiSelectListBox, OptionList, PlainAutoCompleteComboBox, PlainCarousel, PlainCarouselSlideshow, PlainCarouselWithThumbnails, PlainCenteredStrip, PlainCenteredStripHighlight, PlainCenteredStripOpacity, PlainCrossfadeStage, PlainCrossfadeStage, PlainDropdownList, PlainExplorer, PlainFilterComboBox, PlainFilterListBox, PlainListBox, PlainListComboBox, PlainListExplorer, PlainListWithSearch, PlainMenu, PlainModes, PlainMultiSelectListBox, PlainOptionList, PlainSlideshow, PlainSlideshow, PlainSlideshowWithPlayControls, PlainSlideshowWithPlayControls, PlainSlidingPages, PlainSlidingStage, PlainTabs, PlainTabStrip, Slideshow, Slideshow, SlideshowWithPlayControls, SlideshowWithPlayControls, SlidingPages, SlidingStage, Tabs, and TabStrip.

currentIndex property

The index of the current item, or -1 if no item is current.

Type: number

currentindexchanged event

Raised when the currentIndex property changes.

currentItem property

The current item, or null if no item is current.

Type: Element

currentItemRequired property

True if the list should always have a current item (if it has items).

Type: boolean

Default: false

cursorOperationsWrap property

True if cursor operations wrap from last to first, and vice versa.

Type: boolean

Default: false

goFirst() method

Moves to the first item in the list.

Returns: Boolean True if the current item changed, false if not.

goLast() method

Move to the last item in the list.

Returns: Boolean True if the current item changed

goNext() method

Move to the next item in the list.

If the list has no current item, the first item will become current.

Returns: Boolean True if the current item changed

goPrevious() method

Moves to the previous item in the list.

If the list has no current item, the last item will become current.

Returns: Boolean True if the current item changed