Class Menu

Define a Menu block to be displayed into a JBlocks.

Class Summary
Constructor Attributes Constructor Name and Description
 
Menu()

A Menu block holds a set of links.

Method Summary

Class Detail

Menu()

A Menu block holds a set of links.

The constructor should not be invoked directly but JBlocks#newBlock or JBlocks#addNewBlock should be used instead.

Method Detail

  • init(layout, options)
    Initializes a Menu block. The method is invoked by the jBlocks core and must never be called directly.
    Parameters:
    {Object} layout Optional
    see Block#init.
    {Object} options Optional
    in addition to base class options Block#init:
    {Array} options.menuItems Optional
    menu items associated with the Menu block. Each menu item contains the fields:
    • label: the text to be displayed.
    • onClick: a function to be called when the menu item is clicked.
    • shouldDisplay: a function to be called when the menu item is about to be displayed. If it returns false, the entry is not shown.