Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ContextMenu

Hierarchy

  • ContextMenu

Index

Constructors

constructor

Properties

items

Optional onShow

onShow: undefined | function

parentMenu

parentMenu: ContextMenu | null

Methods

addItem

  • addItem(id: string, name: string, submenu: ContextMenu | function | null, selected?: undefined | false | true, disabled?: undefined | false | true, param?: any, ico?: undefined | string, multi?: undefined | false | true): JQuery
  • Add menu item

    Parameters

    • id: string

      menu item identificator

    • name: string

      menu item name

    • submenu: ContextMenu | function | null

      submenu of the item ir callback

    • Optional selected: undefined | false | true

      if true menu item will be selected

    • Optional disabled: undefined | false | true

      if true menu item will be disabled

    • Optional param: any

      parameter that will be passed to callback function

    • Optional ico: undefined | string

      icon class

    • Optional multi: undefined | false | true

      true if this menu item can be used for multiple elements

    Returns JQuery

    DOM element object of this menu item

addSeparator

  • addSeparator(index?: undefined | number): void
  • Parameters

    • Optional index: undefined | number

    Returns void

getIndexById

  • getIndexById(id: string): number
  • Parameters

    • id: string

    Returns number

getItem

  • getItem(id: string): JQuery | null
  • Parameters

    • id: string

    Returns JQuery | null

getSubmenu

hasSubmenu

  • hasSubmenu(id: string): boolean
  • Parameters

    • id: string

    Returns boolean

insertItemAt

  • insertItemAt(index: number, id: string, name: string, submenu: ContextMenu | function, selected?: undefined | false | true, disabled?: undefined | false | true, param?: any, ico?: undefined | string, multi?: undefined | false | true): JQuery
  • Insert menu item at specified index

    Parameters

    • index: number

      index to insert icon at

    • id: string

      menu item identificator

    • name: string

      menu item name

    • submenu: ContextMenu | function

      submenu of the item ir callback

    • Optional selected: undefined | false | true

      if true menu item will be selected

    • Optional disabled: undefined | false | true

      if true menu item will be disabled

    • Optional param: any

      parameter that will be passed to callback function

    • Optional ico: undefined | string

      icon class

    • Optional multi: undefined | false | true

      true if this menu item can be used for multiple elements

    Returns JQuery

    DOM element object of this menu item

removeAllItems

  • removeAllItems(): void
  • Returns void

removeItem

  • removeItem(id: string): void
  • Parameters

    • id: string

    Returns void

setDisabled

  • setDisabled(id: string, disabled: boolean): void
  • Parameters

    • id: string
    • disabled: boolean

    Returns void

setName

  • setName(id: string, name: string): void
  • Parameters

    • id: string
    • name: string

    Returns void

setSelected

  • setSelected(id: string, selected: boolean): void
  • Parameters

    • id: string
    • selected: boolean

    Returns void

setVisible

  • setVisible(id: string, visible: boolean): void
  • Parameters

    • id: string
    • visible: boolean

    Returns void

Static hideAllMenus

  • hideAllMenus(): void
  • Returns void