new AddRemoveListbox(The)
Creates component instance.
Parameters:
Name | Type | Description |
---|---|---|
The |
DOMElement | element. |
Members
$box :jQuery
The DOM element of add item box.
Type:
$dom :jQuery
The DOM element of component.
Type:
added :Object.<string, string>
An added items.
These are items which should not be shown in box.
Type:
args :Array
The module function arguments.
Type:
func :string
The module function which returns items to add.
Type:
io :nge.io.Rmi
The I/O operation in progress.
Type:
name :string
The variable name.
Type:
removed :Object.<string, string>
A removed items.
These are items which should be added to items shown in box.
Type:
size :number
The size property.
Type:
- number
Methods
(static) init(elem)
Initializes component.
Parameters:
Name | Type | Description |
---|---|---|
elem |
DOMElement | The element. |
addItem(value, label)
Adds item to listbox.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | The value. |
label |
string | The label. |
bind(event, ctls)
Binds event to controls.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | The event name. |
ctls |
Object | An object of selector/handler pairs. |
createAddBox()
Creates add item box.
loadItems()
Loads items.
onAddBoxClose($button)
Invoked when add item box is being closed.
Parameters:
Name | Type | Description |
---|---|---|
$button |
jQuery | The button with tooltip attached. |
onAddItem(event)
Invoked when Add button in add item box is clicked.
Parameters:
Name | Type | Description |
---|---|---|
event |
jQuery.Event | The jQuery event. |
onLoadDone(items)
Invoked when loading completes successfuly.
Parameters:
Name | Type | Description |
---|---|---|
items |
Object | The listbox items. |
onLoadFail(The, The)
Invoked when loading fails.
Parameters:
Name | Type | Description |
---|---|---|
The |
string | error message. |
The |
number | error code. |
onRemoveItem(event)
Invoked when remove item control is clicked.
Parameters:
Name | Type | Description |
---|---|---|
event |
jQuery.Event | The jQuery event. |
onSelectItem(event)
Invoked when item is clicked.
Parameters:
Name | Type | Description |
---|---|---|
event |
jQuery.Event | The jQuery event. |