Toolbar(eventManager, itemsopt)

Class Toolbar

new Toolbar(eventManager, itemsopt)

Creates an instance of Toolbar.

Parameters:
Name Type Attributes Default Description
eventManager EventManager

event manager

items Array.<ToolbarItem> <optional>
[]

toolbar items

Extends

Methods

static DefaultToolbar#insertItem(index, item)

insert toolbar item

Parameters:
Name Type Description
index number

index at given item inserted

item ToolbarItem | string | object

toolbar item

_initEvent(eventManager)

init event

Parameters:
Name Type Description
eventManager EventManager

event manager

addButton(button, indexopt)

add button

Parameters:
Name Type Attributes Description
button Button

button instance

index Number <optional>

location the button will be placed

Deprecated:
  • Yes

addDivider() → {jQuery}

add divider

Returns:
jQuery -
  • created divider jquery element
Deprecated:
  • Yes

addItem(item)

add toolbar item

Parameters:
Name Type Description
item ToolbarItem | string | object

toolbar item

destroy()

destroy

Overrides:

disableAllButton()

disable all toolbar button

enableAllButton()

enable all toolbar button

getItem(index) → {ToolbarItem}

get toolbar item at given index

Parameters:
Name Type Description
index number

item index

Returns:
ToolbarItem -
  • toolbar item at the index

getItems() → {Array.<ToolbarItem>}

get toolbar items

Returns:
Array.<ToolbarItem> -
  • toolbar items

indexOfItem(item) → {number}

get index of given item

Parameters:
Name Type Description
item ToolbarItem

toolbar item

Returns:
number -
  • index of given toolbar item

insertItem(index, item)

insert toolbar item

Parameters:
Name Type Description
index number

index at given item inserted

item ToolbarItem | string | object

toolbar item

off(type, fn)

unbind event handler

Parameters:
Name Type Description
type string

event name and selector

fn function

handler function

Inherited From:

on(aType, aFn)

Parameters:
Name Type Description
aType string | object

event name and selector string

aFn function

event handler

Inherited From:

remove()

remove

Inherited From:

removeAllItems()

remove all toolbar items

removeItem(item, destroy) → {ToolbarItem|undefined}

remove an item

Parameters:
Name Type Default Description
item ToolbarItem | number

an toolbar item or index of the item to remove

destroy boolean true

destroy item or not

Returns:
ToolbarItem | undefined -
  • removed item

setItems(items)

set toolbar items

Parameters:
Name Type Description
items Array.<ToolbarItem>

toolbar items

trigger(…args)

trigger event

Parameters:
Name Type Attributes Description
args object <repeatable>

event name & extra params

Inherited From: