awa.ui.CollectionSelect Class
/var/www/azaleahealth.com/branches/docs/source_repo/awa/resources/apps/js/awa/ui/CollectionSelect.js:15
defaultSelection and defaultValue are what show as the first option in the select. They should NOT be used to provide the initial set value (i.e. when displaying form data during a model edit For existing selected values, please use the value option
Constructor
awa.ui.CollectionSelect
-
options.collection -
[options.model] -
[options.modelAttribute] -
[options.defaultSelection] -
[options.generateDefault] -
[options.showDisabled] -
[options.showDisabledOption] -
[options.defaultKey] -
[options.defaultValue] -
[options.value]
Parameters:
-
options.collectionawa.mvc.CollectionNote: If this collection is not an instance of Backbone.Collection and it contains keys beginning with "_" (e.g. "_privateKey", "_keyName", etc.), those keys will not be displayed in the select.
-
[options.model]awa.mvc.Model optional -
[options.modelAttribute]String optionalattribute of the model to bind to
-
[options.defaultSelection]String optionaldefault option element value to set the select to (usually empty string or 0)
-
[options.generateDefault]Boolean optionalIf true then generate a default option for the select.
-
[options.showDisabled]Boolean optionalAllow the user to see disabled models. Defaults to false.
-
[options.showDisabledOption]Boolean optionalPresents the option to show disabled models. ignored if showDisabled is true
-
[options.defaultKey]String optionalvalue of default option
-
[options.defaultValue]String optionaltext content of default option
-
[options.value]String optionalthe current value the select is or should be set to
Item Index
Methods
_establishModelLink
()
Null
private
If a model and a named attribute is provided then this view will bind to that element
Returns:
not available
buildDefaultOption
()
HTMLOptionElement | Boolean
If a default option is given, create the element.
Returns:
Returns either a select option or true,false
setCollection
-
collection
Sets the collection for the select. Note: this does not rebuild the collection. You must call rebuild yourself.
Parameters:
-
collectionawa.mvc.Collection | ArraySource collection
Returns:
returns this