Menu.insertItemAfter

Syntax

insertItemAfter (item: Object, afterItem: PP.Ui.MenuItem)

Parameters

item. Menu item to be inserted.

afterItem. Menu item after which the new menu item will be inserted.

Description

The insertItemAfter method inserts a menu item after a specified item.

Example

To execute the example, the page must contain a Menu component (see Example of creating the Menu component). Insert menu items before and after the menu item with the index 2:

menu.insertItemAfter("Item2.1", menu.getItems()[2]);

menu.insertItemBefore("Item1.1", menu.getItems()[2]);

 

After executing the example the menu items named Item1.1 and Item2.1 are inserted to the menu:

See also:

Menu