dojox/grid/enhanced/plugins/Menu (version 1.10)

dojox/grid/enhanced/_Plugin

Summary

Provides context menu support, including header menu, row menu, cell menu and selected region menu

Usage

var foo = new Menu();
dojox/grid/enhanced/plugins/Menu

Examples

Example 1

<div dojoType="dojox.grid.EnhancedGrid"
    plugins="{menus:{headerMenu:"headerMenuId", rowMenu:"rowMenuId", cellMenu:"cellMenuId",
                       selectedRegionMenu:"selectedRegionMenuId"}}" ...>
</div>

Property Summary

  • _connectsList of all connections.
  • _subscribesList of all subscribes.
  • gridGrid that the plugin belongs to
  • namePlugin name
  • optionPlugin properties - leveraged with default and user specified properties. e.g. for dnd plugin, it may look like {&quot;class&quot;: dojox.grid.enhanced.plugins.DnD, &quot;dependency&quot;: [&quot;nestedSorting&quot;], ...}
  • privatesPrivate properties/methods shouldn&#39;t be mixin-ed anytime.
  • typesmenu types

Method Summary

  • _getMenuWidget(menu) Fetch the required menu widget(should already been created)
  • _initMenu(menuType,menu)
  • _setCellMenuAttr(menu) Set cell menu widget
  • _setMenuAttr(menu,menuType) Bind menus to Grid.
  • _setRowMenuAttr(menu) Set row menu widget
  • _setSelectedRegionMenuAttr(menu) Set row menu widget
  • connect(obj,event,method) Connects specified obj/event to specified method of this object.
  • destroy() Destroy all resources. _Grid.destroy() will unbind headerMenu
  • disconnect(handle) Disconnects handle and removes it from connection list.
  • init()
  • showMenu(e) Show appropriate context menu Fired from dojox.grid.enhanced._Events.onRowContextMenu, 'this' scope - Grid
  • subscribe(topic,method) Subscribes to the specified topic and calls the specified method of this object.
  • unsubscribe(handle) Un-subscribes handle and removes it from subscriptions list.

Event Summary

Properties

_connects

List of all connections.

_subscribes

List of all subscribes.

grid

Grid that the plugin belongs to

name

Plugin name

option

Plugin properties - leveraged with default and user specified properties. e.g. for dnd plugin, it may look like {"class": dojox.grid.enhanced.plugins.DnD, "dependency": ["nestedSorting"], ...}

privates

Private properties/methods shouldn't be mixin-ed anytime.

types

menu types

Methods

_getMenuWidget(menu)

Fetch the required menu widget(should already been created)

Parameter Type Description
menu String | Widget(dijit.Menu)
Returns:undefined
_initMenu(menuType,menu)
Parameter Type Description
menuType String
menu String | dijit/Menu
_setCellMenuAttr(menu)

Set cell menu widget

Parameter Type Description
menu Widget(dijit.Menu)
_setMenuAttr(menu,menuType)

Bind menus to Grid.

Parameter Type Description
menu Widget(dijit.Menu)
menuType String
_setRowMenuAttr(menu)

Set row menu widget

Parameter Type Description
menu Widget(dijit.Menu)
_setSelectedRegionMenuAttr(menu)

Set row menu widget

Parameter Type Description
menu Widget(dijit.Menu)
connect(obj,event,method)

Connects specified obj/event to specified method of this object.

Parameter Type Description
obj undefined
event undefined
method undefined
Returns:undefined

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when foo.bar() is called, call the listener in the scope of plugin
plugin.connect(foo, "bar", function(){
    console.debug(this.xxx());//"this" - plugin scope
});
destroy()

Destroy all resources. _Grid.destroy() will unbind headerMenu

disconnect(handle)

Disconnects handle and removes it from connection list.

Parameter Type Description
handle undefined
init()
showMenu(e)

Show appropriate context menu Fired from dojox.grid.enhanced._Events.onRowContextMenu, 'this' scope - Grid

Parameter Type Description
e Event
subscribe(topic,method)

Subscribes to the specified topic and calls the specified method of this object.

Parameter Type Description
topic undefined
method undefined
Returns:undefined

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when /my/topic is published, call the subscriber in the scope of plugin
// with passed parameter - "v"
plugin.subscribe("/my/topic", function(v){
    console.debug(this.xxx(v));//"this" - plugin scope
});
unsubscribe(handle)

Un-subscribes handle and removes it from subscriptions list.

Parameter Type Description
handle undefined

Events

onPostInit()

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when /my/topic is published, call the subscriber in the scope of plugin
// with passed parameter - "v"
plugin.subscribe("/my/topic", function(v){
    console.debug(this.xxx(v));//"this" - plugin scope
});
onPreInit()

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when /my/topic is published, call the subscriber in the scope of plugin
// with passed parameter - "v"
plugin.subscribe("/my/topic", function(v){
    console.debug(this.xxx(v));//"this" - plugin scope
});
onSetStore(store)

Called when store is changed.

Parameter Type Description
store undefined

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when /my/topic is published, call the subscriber in the scope of plugin
// with passed parameter - "v"
plugin.subscribe("/my/topic", function(v){
    console.debug(this.xxx(v));//"this" - plugin scope
});
onStartUp()

Examples

Example 1

var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...});
// when /my/topic is published, call the subscriber in the scope of plugin
// with passed parameter - "v"
plugin.subscribe("/my/topic", function(v){
    console.debug(this.xxx(v));//"this" - plugin scope
});
Error in the documentation? Can’t find what you are looking for? Let us know!