org.visallo.detail.toolbar

Add Inspector toolbar items

These items can be added to single entity/edge inspectors, or the multiple selection inspector (or both). Use canHandle to specify what inspectors to apply to.

Examples

Add Button

registry.registerExtension('org.visallo.detail.toolbar', {
    event: 'myEvent',
    title: 'Test Button'
})

Add Divider

registry.registerExtension('org.visallo.detail.toolbar', { divider: true })

Registration

registry.registerExtension("org.visallo.detail.toolbar", config)

Source:
Tutorials:
See:
Configuration Properties:
Name Type Attributes Default Description
event string

The event to fire when clicked

title string

The text to display in the toolbar

subtitle string <optional>

The text to display underneath the title

cls string <optional>

A CSS classname to add to the items element. Add disabled to prevent events from firing

canHandle canHandle <optional>

Whether this item should be added based on what's in the detail pane.

divider boolean <optional>
false

Specify true for a toolbar menu divider instead of an actionable item

submenu Array.<object> <optional>

Specify list of submenu toolbar items. Only one level supported

right boolean <optional>
false

Specify true to float item to the right

options object <optional>
Properties
Name Type Attributes Description
insertIntoMenuItems insertIntoMenuItems <optional>

function to place the item in a specific location/order

Validation Function

Extensions registered must pass this validation check to be used.

function extensionValidator(e) {
    return e.divider || 'event' in e && 'title' in e;
}

Type Definitions

canHandle(objects) → {boolean}

Source:
Parameters:
Name Type Description
objects Array.<object>

List of all objects displayed in detail pane

Returns:

Whether this extension should display for objects

Type
boolean

insertIntoMenuItems(item, items)

Source:

Function that is responsible for inserting item into items.

The items array should be mutated, placing the item into the list, or into a submenu of an item in the list.

Example
insertIntoMenuItems: function(item, items) {
    // Insert item into specific position in items list
    items.splice(3, 0, item);
}
Parameters:
Name Type Description
item object

the toolbar item to insert

items Array.<object>

The existing toolbar items