toolitems.factory
ToolitemsFactory : d2/sdk/controls/toolbar/toolitems.factory
Create a new toolbar definiftion. The definition could be used to create a menubar in UI.
Extends: Object
Example (Static toolbar configuration)
define([
'd2/sdk/controls/toolbar/toolitem.factory'
], function(ToolitemsFactory){
'use strict';
return {
rightToolbar: new ToolitemsFactory({
main: [
{
signature: 'D2-RefreshList',
name: 'Refresh',
iconName: 'csui_action_refresh32',
enabled: true
}
]
}, {
maxItemsShown: 1
dropDownText: 'More',
dropDownIconName: 'csui_action_more32'
});
};
});
- ToolitemsFactory :
d2/sdk/controls/toolbar/toolitems.factory
ToolitemsFactory~ToolitemsFactory
Kind: inner class of ToolitemsFactory
new ToolitemsFactory(toolItems, options)
| Param | Type | Description |
|---|---|---|
| toolItems | object | Key-value pairs where key represents a group name and value represents menu items under that group. Each value should be an array of |
| options | object | Controls options |
| options.maxItemsShown | number | Number of menus to be shown at max if this toolbar config is used to draw a menubar. Setting it to |
| options.dropDownText | string | Text shown for dropdown button |
| options.dropDownIconName | string | Action icon name for the dropdown button. |
ToolitemsFactory~ToolitemType : Object
Kind: inner typedef of ToolitemsFactory
Properties
| Name | Type | Default | Description |
|---|---|---|---|
| signature | string | Signature of the command bound to this menu item. | |
| name | string | Text displayed for this menu item. | |
| iconName | string | Action icon name for this menu | |
| commandData | * | Arbitrary data. Must have a | |
| [subItemOf] | string | ID of the menu item for which the current item is a sub-menu | |
| [actionProperties] | * | Additional menu configuration data later used by matching command implementations. | |
| [promoted] | Boolean | false | Whether this menu is promoted. Promoted menus represent priority actions that are fetched and shown before others. |
| type | string | Menu type. Should correlate with action types from D2-REST | |
| [dynamic] | Boolean | false | Whether this menu is a dynamic menu. |
| [enabled] | Boolean | false | Whether this menu should be always enabled. |