The EventList property specifies which events should be handled by the current menu.
The events are specfied by separating them with commas (,).
The possible events are:
event is triggered before the menu is shown on the page.
event is triggered after the menu has been displayed on the page.
event is triggered before the menu is closed.
event is triggered after the menu has been closed.
event is triggered before the menu item click is processed.
event is triggered after the menu item click has been processed.
After you have specified the events to be used by a menu, you can edit the file easy_menu_events_version.js
and write your own code inside the predefined functions. You can find more details about each function and the
parameters they get from the comments inside the file.
events allow you to return a boolean value (true or false) and depending on that value, the
event is carried on or dropped. For example if you return false from OnBeforeMenuOpen, the menu will not be
displayed on the page.
Events are very useful since you can use them to add your own functionality to the menus while they are working:
- you can add/remove items.
- you can prevent the menus from being opened/closed or the items from being clicked.
- you can use our AJAX Page
control to send data to server for saving.
Here is how you can specify the EventList property:
<oem:EasyMenu id="EasyMenu1" runat="server" EventsScriptPath="events_script" EventList="OnBeforeMenuOpen, OnAfterMenuClose, OnBeforeItemClick">
The menu below will alert you on any item click with the information available to be sent to server.
For these menus we've used:
<oem:EasyMenu id="EasyMenu1" runat="server" EventsScriptPath="events_script" EventList="OnAfterItemClick">