AppSuite:Action links: Difference between revisions
From Open-Xchange
m (stability index) |
No edit summary |
||
Line 1: | Line 1: | ||
<!-- !!! --> | |||
<!-- PLEASE APPLY CHANGES ONLY TO THE NEW TECHNICAL DOCUMENTATION: wd/frontend/web/documentation --> | |||
<!-- !!! --> | |||
{{Stability-experimental}} | {{Stability-experimental}} | ||
Revision as of 06:29, 10 February 2016
API status: In Development
Please note: This page is currently under construction. It might change any minute now.
Understanding action links
Action links can be used to apply an action to an item or even a selection of items. Use them to extend actions for existing items or create a toolbox for your custom items available in your application.
The API
Action
Creating a new action is pretty straight forward. Just create a new Action and give it a unique name (internally we use slashes to indicate a module hierarchy, so names are inherently unique) and provide a few options.
var action = new Action('unique/name/of/my/action', { //some options go in here });
Available options
In the options parameter you can provide the actual logic for the action. You can provide callbacks, requirements and more.
- id
- a unique identifier (String)
- requires (optional)
- (String) - a String containing one or more special keywords that are required for this action to be active
- toplevel
- one
- some
- delete
- …
- (Function) - a function that returns a Boolean value and gets a Baton object as parameter
- (String) - a String containing one or more special keywords that are required for this action to be active
- multiple (optional)
- (Function) - a callback function, called when the action is triggered with a list of elements
- action (optional)
- (Function) - a callback function, called when the action is triggered for one element