API Docs for: 2.7.3
Show:

API.ui Class

Module: API
Parent Module: Wanaplan

API for Wanaplan User Interface.

Constructor

API.ui

()

Methods

addMainMenuItem

(
  • item
  • [menuPath]
)

Adds an item to the main menu.

MenuItem format :
{ title : _("title"), icon : "pathToIcon", action : "eventName", index: 100, items : [subitem1, subitem2] }

Parameters:

  • item Object

    MenuItem as described above

  • [menuPath] String optional

    The desired path for this item inside the targeted menu (default is ".").

addSubMenuItem

(
  • item
  • [menuPath]
)

Adds an item to the sub menu.

Parameters:

  • item Object

    MenuItem as described in doc of function addMainMenuItem

  • [menuPath] String optional

    The desired path for this item inside the targeted menu (default is ".").

addTopMenuItem

(
  • item
  • [menuPath]
)

Adds an item to the top menu.

Parameters:

  • item Object

    MenuItem as described in doc of function addMainMenuItem

  • [menuPath] String optional

    The desired path for this item inside the targeted menu (default is ".").

getWidgetContainer

() Object

Returns a DOM element containing the UI widgets, which you can manipulate

Returns:

Object:

The DOM Element containing widgets

removeMainMenuItem

(
  • item
  • [menuPath]
)

Removes an item from the main menu.

Parameters:

  • item Object | String

    The MenuItem to remove or its id.

  • [menuPath] String optional

    The path of this item (default is ".").

removeSubMenuItem

(
  • item
  • [menuPath]
)

Removes an item from the sub menu.

Parameters:

  • item Object | String

    The MenuItem to remove or its id.

  • [menuPath] String optional

    The path of this item (default is ".").

removeTopMenuItem

(
  • item
  • [menuPath]
)

Removes an item from the top menu.

Parameters:

  • item Object | String

    The MenuItem to remove or its id.

  • [menuPath] String optional

    The path of this item (default is ".").

Events

wnp.menu.main.add

Fired to add a menu item into the main menu.

wnp.menu.main.remove

Fired to remove a menu item from the main menu.

wnp.menu.top.add

Fired to add a menu item into the top menu.

wnp.menu.top.delete

Fired to delete a menu item from the top menu.

wnp.menu.top.sub.add

Fired to add a menu item into the sub menu.

wnp.menu.top.sub.delete

Fired to delete a menu item from the sub menu.