Class: DropdownModel

Snippets.Dropdown DropdownModel

DropdownModel
modules/snippets/dropdown/model.js, line 11

Extends

Methods

addValueModel(value, group){void}

modules/snippets/dropdown/model.js, line 118
creates a model value and adds it to the value collection
Name Type Description
value string value
group string | undefined name of its group

getDisplayName(value){string}

modules/snippets/dropdown/model.js, line 135
Returns a string ja or nein
Name Type Description
value string true or false
Returns:
or nein

getSelectedValues(){object}

modules/snippets/dropdown/model.js, line 252
Returns an object with all values of the values collection
Returns:
object

replaceValueModels(newValueList, preselectedValues){void}

modules/snippets/dropdown/model.js, line 99
removes all value-models from collection and calls addValueModel for each new value
Name Type Description
newValueList Array.<string> new dropdown values
preselectedValues Array.<string> new preselected values

resetValues(){void}

modules/snippets/dropdown/model.js, line 150
resetCollection

setDisplayName(value){void}

modules/snippets/dropdown/model.js, line 282
Setter for displayName
Name Type Description
value string displayName

setIsMultiple(value){void}

modules/snippets/dropdown/model.js, line 273
Setter for isMultiple
Name Type Description
value boolean isMultiple

setIsOpen(value){void}

modules/snippets/dropdown/model.js, line 225
sets the isOpen attribute
Name Type Description
value boolean value

setValueModelsToShow(models, isGrouped){void}

modules/snippets/dropdown/model.js, line 235
sets the valueModelsToShow attribute
Name Type Description
models Array.<Backbone.Model> all value models that can be selected
isGrouped boolean flag if the objects should be grouped

updateSelectableValues(values){void}

modules/snippets/dropdown/model.js, line 206
checks the value models if they are selectable or not
Name Type Description
values Array.<string> filtered values
Fires:
  • DropdownView#event:render

updateSelectedValues(values){void}

modules/snippets/dropdown/model.js, line 181
checks the value models if they are selected or not
Name Type Description
values string | Array.<string> selected value(s) in the dropdown list

updateValueModels(valueList, isGrouped){void}

modules/snippets/dropdown/model.js, line 68
checks for each value whether it already exists and removes the models that are not in the valueList anymore
Name Type Description
valueList Array.<string> | Array.<object> init dropdown values
isGrouped boolean flag if the objects should be grouped

updateValues(value){void}

modules/snippets/dropdown/model.js, line 163
updateCollection
Name Type Description
value array selected value