-
Notifications
You must be signed in to change notification settings - Fork 34
classes_lib_controls_contextmenu.class
Wraps a context menu.
Extends: Control » Renderable
To change on of the following defaults menuStyle An object containing styleName:value pairs for styling the containing <ul> menu. itemStyle An object containing styleName:value pairs for styling the <li> elements. itemHoverStyle An object containing styleName:value pairs for styling the hover behaviour of <li> elements. shadow Boolean: display a basic drop shadow on the menu. Defaults to true eventPosX Allows you to define which click event is used to determine where to place the menu. There are possibly times (particularly in IE6) where you will need to set this to "clientX". Defaults to: 'pageX' eventPosY Allows you to define which click event is used to determine where to place the menu. There are possibly times (particularly in IE6) where you will need to set this to "clientY". Defaults to: 'pageY' onContextMenu(event) A custom event function which runs before the context menu is displayed. If the function returns false the menu is not displayed. This allows you to attach the context menu to a large block element (or the entire document) and then filter on right click whether or not the context menu should be shown. onShowMenu(event, menu) A custom event function which runs before the menu is displayed. It is passed a reference to the menu element and allows you to manipulate the output before the menu is shown. This allows you to hide/show options or anything else you can think of before showing the context menu to the user. This function must return the menu.
Definition: public function AddDefault($defaultname, $value)
Returns: void
Parameters:
-
string $defaultname
Key to be set -
string $value
The new value
Add menuitem to contextmenu $img and title are optional to be able to choose which one is needed. $id is needed to bind functions to menuitems via AddBinding
Definition: public function AddMenuItem($id, $bindingfunction, $title, $img)
Returns: void
Parameters:
-
string $id
Elements id -
string $bindingfunction
JS function to bind to click -
string $title
Item title -
string $img
Item icon#
Specifies a context menu trigger Define one or more jquery-selectors for elements which are uses as triggers for the contextmenu if no trigger is defined the document-selector will be used
Definition: public function AddTrigger($triggerselector)
Returns: void
Parameters:
-
string $triggerselector
Valid jQuery selector
If called the left-click is also bound. It only works if the menu has one or more triggers
Definition: public function BindLeftClick()
Returns: void
OVERRIDE Prepares JS init code