ControlsView Class
/var/www/azaleahealth.com/branches/docs/source_repo/awa/resources/apps/js/awa/mvc/ControlsView.js:5
This is a basic part of the new gui structure for awa. It extends the View class and should be used as a control/menu bar for contents views
inputs: [
{
type: 'button', //button is default, also takes select, date, sectionButton, more, etc.
id:
align:,
content: 'Save', //used for button
tip:,
color:,
callback:,
collection:
collectionID:
collectionValue:
contents: "Cancel", callback: "onCancel", tip: "Update Demographics"},
{contents: "Save Changes", callback: "save", tip: "Save Changes", color: "red"},
{contents: "Save & Close", callback: "onSaveAndClose", tip: "Save & Close", color: "red"},
// {icon: "print16", contents: "Print", callback: "onPrint", tip: "Update Demographics"},
{icon: "expand16", align: "right", callback: "expandAllSections"},
{icon: "collapse16", align: "right", callback: "collapseAllSections"}
]
Constructor
ControlsView
()
Item Index
Methods
Methods
addButton
-
config
Parameters:
-
configObjectconfiguration object with various properties
-
[contents]Object optionalhtml contents of the button (icons, text, etc.)
-
[icon]Object optionalhtml contents of the button (icons, text, etc.)
-
[type]Object optionalbutton widget type, decides the color
-
[callback]Function optionaldefined callback
-
Returns:
not available
addFilter
-
config -
callback
Parameters:
-
configObjectconfiguration object with various properties
-
keyStringhtml contents of the button (icons, text, etc.)
-
defaultKeyStringhtml contents of the button (icons, text, etc.)
-
defaultValueStringhtml contents of the button (icons, text, etc.)
-
collectionObjecthtml contents of the button (icons, text, etc.)
-
collectionKeyStringhtml contents of the button (icons, text, etc.)
-
collectionValueStringhtml contents of the button (icons, text, etc.)
-
collectionTemplateStringhtml contents of the button (icons, text, etc.)
-
-
callbackFunctionfunction to add to config
Returns:
not available
bindToModel
-
[model]
Parameters:
-
[model]awa.mvc.Model | Backbone.Model optionalModel to bind to
Returns:
destroy
()
awa.mvc.View
Returns:
doChildrenLayouts
()
Undefined
Returns:
doLayout
()
Undefined
Returns:
generateControlsConfigFromModelFilter
-
filter -
args
Generates controls from filters
Parameters:
-
filterobject[object that should contain the filter type]
-
argsobject[merges in to the generated configs. Good for passing the desired callback]
Returns:
[return controls config]
getWidget
()
Array
Returns:
onRendered
-
callback -
context
Parameters:
-
callbackFunctionCallback -
contextObjectDefines scope of callback
Returns:
refresh
()
awa.mvc.View
Returns:
render
()
Undefined
Returns:
requestChange
-
callback
Parameters:
-
callbackFunctionfunction to call when you have determined if the view can close or not. If it can close, return an object with property 'success' set to 1.
Returns:
requestClose
-
callback
Parameters:
-
callbackFunctionfunction to call when you have determined if the view can close or not. If it can close, return an object with property 'success' set to 1.
Returns:
setElement
-
element -
[delegate]
Parameters:
-
elementJquery.SelectorJquery selector -
[delegate]? optional?
Returns:
setup
-
config
For deprecation, do not use.
Parameters:
-
configObjectconfiguration object with various properties
-
targetViewObjectContents view that this view controls
-
titleObjectContents view that this view controls
-
[template]Object optionalTemplate to render. Can either be a string locator for the old templates or a compiled underscore template
-
[templateArgs]Object optionalarguments to pass through to the template when rendering
-
[targetElementId]String optionalMostly for testing, id of element this view controls
-
Returns:
nothing, do not use
triggerRendered
-
args
Parameters:
-
argsObjectparameter to emit
Returns:
viewOptions
()
Array
Returns:
Properties
__parent__
View
Default: undefined
className
Boolean | Function
Default: "awa-mvc-View"
closeOnReplace
Boolean
Default: false
globalKeys
Object
Default: undefined
keys
Object
Default: undefined
refreshOnReplace
Boolean
Default: true
rendered
Boolean
Default: false
title
Strin
Default: "View"
tpl
Function
Default: undefined
tplArgs
Object
Default: undefined