contextmenu_handler

Client side event handler to be called when user right click on a node.

Note: This is a prototype, not a function. You should provide a function that matches this prototype if you wish to handle the corresponding event on the client side. The prototype provides information about the arguments and return value of the function you provide.

Syntax
JavaScript
 contextmenu_handler(e, control, item, cell)

Parameters

e
The DOM event object. You should pass this parameter to eo_ShowContextMenu if you do display a context menu.
control
The Control that raised this event.
item
For a TreeView, this is the TreeNode object that was right-clicked; for a Grid, this is the GridItem object that was clicked.
cell
The GridCell object for the Grid control. This argument is null for a TreeView control.

Return Value

Returns false if a context menu is not displayed.

Remarks

This is a prototype, not a function. You should provide this function if you wish to display a context menu for a TreeView object.

Inside your function you can call eo_ShowContextMenu to display a context menu. You can also modify the context menu based on the menu's client side interface before displaying it.

Return true if your code has displayed a context menu, otherwise return false.

For a TreeView, The item argument is saved by the tree view and can be later retrieved by calling getContextNode function even after your handler returns. getContextNode returns a valid TreeNode object until the context menu is closed.

For a Grid, The item argument is saved by the grid and can be later retrieved by calling getContextNode function even after your handler returns. getContextItem returns a valid GridItem object until the context menu is closed.

If your context menu's RaisesServerEvent is set to true and you handle the context menu's ItemClick event to perform additional logics on the server side, you can also get the node that the context menu acted upon on the server side through server side ContextNode property, or the grid item through server side ContextItem property.

See Also