WanaPlan

API Docs for: 2.7.0
Show:

API.ui

Module: API
Parent Module: Wanaplan

Summary

API for Wanaplan User Interface.

Constructor

API.ui

Syntax

API.ui

()

Summary

Methods

addMainMenuItem

Syntax

addMainMenuItem

(
  • item
  • [menuPath]
)

Summary

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

Syntax

addSubMenuItem

(
  • item
  • [menuPath]
)

Summary

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

Syntax

addTopMenuItem

(
  • item
  • [menuPath]
)

Summary

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

Syntax

getWidgetContainer

() Object

Summary

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

Returns:

Object:

The DOM Element containing widgets

removeMainMenuItem

Syntax

removeMainMenuItem

(
  • item
  • [menuPath]
)

Summary

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

Syntax

removeSubMenuItem

(
  • item
  • [menuPath]
)

Summary

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

Syntax

removeTopMenuItem

(
  • item
  • [menuPath]
)

Summary

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

Syntax

wnp.menu.main.add

Summary

Fired to add a menu item into the main menu.

wnp.menu.main.remove

Syntax

wnp.menu.main.remove

Summary

Fired to remove a menu item from the main menu.

wnp.menu.top.add

Syntax

wnp.menu.top.add

Summary

Fired to add a menu item into the top menu.

wnp.menu.top.delete

Syntax

wnp.menu.top.delete

Summary

Fired to delete a menu item from the top menu.

wnp.menu.top.sub.add

Syntax

wnp.menu.top.sub.add

Summary

Fired to add a menu item into the sub menu.

wnp.menu.top.sub.delete

Syntax

wnp.menu.top.sub.delete

Summary

Fired to delete a menu item from the sub menu.