DHTMLX Docs & Samples Explorer

dhtmlxMenu API Methods

Init

Constructor/Destructor

Loading Data

  • loadXML loads menu data from an xml file and calls onLoadFunction when loading is done
  • loadXMLString loads menu data from an xml string and calls onLoadFunction when loading is done
  • loadFromHTML loads menu data from an html and calls onLoadFunction when loading is done
  • enableDynamicLoading enables dynamic loading of sublevels

Icons/Skin

Hide/Clear

  • hide hides any open menu polygons
  • clearAll clears all loaded items

Common

  • setOverflowHeight limits the maximum number of visible items in polygons
  • setTopText sets top level additional text (in case of usual menubar)
  • setVisibleArea sets the area in which the menu can appear, if the area is not set, the menu will occupy all available visible space
  • setAlign sets top level menu align
  • setRTL sets right-to-left mode
  • setOpenMode sets open mode for the menu
  • setWebModeTimeout sets hide menu timeout (web mode only)

Context Menu

Init

Context Menu Zones

Show/Hide

Autohide

  • setAutoHideMode sets to false to prevent hiding a contextual menu by a click
  • setAutoShowMode sets to false to prevent showing a contextual menu by a click

Hide All Mode

Events

Items

Add/Remove

Checkboxes

Radiobuttons

Common

State

Visibility

Position

  • setItemPosition sets new item's position in the current polygon (moves an item inside the single level)
  • getItemPosition returns item's position in the current polygon

Text

Icons

Tooltips

Hrefs

  • setHref sets href to item, overwrite old if exists
  • clearHref clears item href and back item to default onClick behavior

UserData

HotKeys

  • setHotKey sets menu hot-key (just text label)
  • getHotKey returns item's hot-key (just text label)