Thursday, February 22nd, 2007p>Harel Malka needed a right click context menu for an application, and found that the offerings out there although provide a right click menu, do not actually provide any context. The menus are predefined in advance and dot really relate directly to what you clicked.
For example, If I right click a contact name link, I’d like my context menu to show me action links relating to that specific contact, such as: Email [contact email], Call [contact phone], Edit [Contact name] etc.
Harel created a library to do this for him called rightcontext.
- Menu items that link somewhere
- Menu items that display hardcoded text
- Menu items that retrieve text via a remote ‘ajax’ call
- Menu item separators
- Image icons for menu items
- Supports multiple different menus that can be called depending on the element clicked
- All menu items can contain [tags] which are transformed at runtime to the values embedded in the clicked element
- Conditional evaluation of menu items. An item can show or not show depending on a specified condition in the menu template (new in v0.2.3)
- CSS based look and feel
You simply define your menu â€˜templatesâ€™ and add a â€˜contextâ€™ attribute (and any additional custom ones you need) to each element youâ€™d like to have a context menu:
- context="actionsMenu" attr1="name" attr2="firstname.lastname@example.org" .....
Posted by Dion Almaer at 7:44 am