Search.../

orderTabs( )

Changes the order of the tabs in a tabs element.

Description

The orderTabs() function changes the order in which tab menu items are displayed. It reorders the array contained in the tabs property.

Syntax

function orderTabs(orderedTabIds: Array<string> | Array<Tab>): Promise<void>

orderTabs Parameters

NAME
TYPE
DESCRIPTION
orderedTabIds
Array<string> | Array<Tab>

The tab elements, or the tab IDs without a preceding # character, in the desired new order. Tab elements and IDs can be mixed. The array must include each element (or its ID) once, otherwise the tabs are not reordered.

Returns

Fulfilled - when the tabs are reordered.

Return Type:

Promise<void>

Was this helpful?

Reorder tabs using tab IDs

Copy Code
1$w("#myTabsElement").orderTabs(["singleTab3", "singleTab1", "singleTab2"]);
2
3let myUpdatedTabs = $w("#myTabsElement").tabs;
4/*
5 * [
6 * $w("#singleTab3"),
7 * $w("#singleTab1"),
8 * $w("#singleTab2")
9 * ]
10 */
Reorder tabs using tab elements

Copy Code
1$w("#myTabsElement").orderTabs([$w("#singleTab3"), $w("#singleTab1"), $w("#singleTab2")]);
2
3let myUpdatedTabs = $w("#myTabsElement").tabs;
4/*
5 * [
6 * $w("#singleTab3"),
7 * $w("#singleTab1"),
8 * $w("#singleTab2")
9 * ]
10 */