ludo.menu.Context


new ludo.menu.Context(config)

Context menu class. You can create one or more context menus for a component by using the
ludo.View.contextMenu config array,

Parameters:
Name Type Description
config Object
Properties
Name Type Description
selector string

Show context menu only for DOM nodes matching a CSS selector. The context menu will also
be shown if a match is found in one of the parent DOM elements. example: selector:'.my-class'

recordType string

Similar to selector, but focused on JSON data.
It asks it's parent view's getRecordByDOM(e.target) (must be implemented), which will return something like { "name": "Oslo", type:"city" }.
If config.recordType is "city", the context menu will be shown, otherwise it will not.
This is typically useful in tree views and grids.

Source:
Example
new ludo.Window({
           contextMenu:[{
               selector : '.my-selector',
               children:[{label:'Menu Item 1'},{label:'Menu item 2'}],
               listeners:{
                   click : function(menuItem, menu){
                       // Do something
                   }
               }

           }]
      });

Extends

  • menu.Menu

Methods


getSelectedRecord()

when recordType property is defined, this will return the selected record of parent applyTo,
example: record in a tree

Source:
Returns:

object record