Class M.SelectionListView
Extends
M.View.
This defines the prototype of any selection list view. A selection list view displays
a list with several items of which either only one single item (M.SINGLE_SELECTION) or
many items (M.MULTIPLE_SELECTION) can be selected.
Defined in: selection_list.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
This property is used to define a method that is executed onSelect of an
item of this selection list.
|
|
Determines whether to remove all item if the list is updated or not.
|
|
The selected item(s) of this list.
|
|
The selection mode for this selection list.
|
|
The type of this object.
|
- Fields borrowed from class M.View:
- childViews, contentBinding, cssClass, cssClassOnError, cssClassOnInit, cssStyle, hasFocus, html, id, isInline, isView, modelId, parentView, triggerActionOnChange, triggerActionOnEnter, triggerActionOnKeyUp, value
Method Attributes | Method Name and Description |
---|---|
addItem(item)
This method adds a new selection list item to the selection list view by simply appending
its html representation to the selection list view inside the DOM.
|
|
This method returns the selected item's value(s) either as a String (M.SINGLE_SELECTION)
or as an Array (M.MULTIPLE_SELECTION).
|
|
itemSelected(id)
This method is called everytime a item is selected / clicked.
|
|
This method removes all of the selection list view's items by removing all of its content in
the DOM.
|
|
This method de-selects all of the selection list's items.
|
|
setSelection(selection)
This method can be used to select items programmatically.
|
- Methods borrowed from class M.View:
- addCssClass, attachToObservable, clearHtml, computeValue, contentDidChange, delegateValueUpdate, design, gotFocus, lostFocus, nl2br, removeCssClass, removeCssProperty, renderUpdate, secure, setCssProperty, setValueFromDOM, style, theme, themeChildViews
- Methods borrowed from class M.Object:
- bindToCaller, create, destroy, extend, get, include, set
Field Detail
{Object}
onSelect
This property is used to define a method that is executed onSelect of an
item of this selection list.
{Boolean}
removeItemsOnUpdate
Determines whether to remove all item if the list is updated or not.
{String, Array}
selection
The selected item(s) of this list.
{String}
selectionMode
The selection mode for this selection list. This can either be single or
multiple selection. To set this value use one of the two constants:
- M.SINGLE_SELECTION
- M.MULTIPLE_SELECTION
{String}
type
The type of this object.
Method Detail
addItem(item)
This method adds a new selection list item to the selection list view by simply appending
its html representation to the selection list view inside the DOM. This method is based
on jQuery's append().
- Parameters:
- {String} item
- The html representation of a selection list item to be added.
{String|Array}
getSelection()
This method returns the selected item's value(s) either as a String (M.SINGLE_SELECTION)
or as an Array (M.MULTIPLE_SELECTION).
- Returns:
- {String|Array} The selected item's value(s).
itemSelected(id)
This method is called everytime a item is selected / clicked. If the selected item
changed, the defined onSelect action is triggered.
- Parameters:
- {String} id
- The id of the selected item.
removeAllItems()
This method removes all of the selection list view's items by removing all of its content in
the DOM. This method is based on jQuery's empty().
removeSelection()
This method de-selects all of the selection list's items.
setSelection(selection)
This method can be used to select items programmatically. The given parameter can either
be a String (M.SINGLE_SELECTION) or an Array (M.MULTIPLE_SELECTION).
- Parameters:
- {String|Array} selection
- The selection that should be applied to the selection list.