awa.mvc.Action Class
/var/www/azaleahealth.com/branches/docs/source_repo/awa/resources/apps/js/awa/mvc/Action.js:2
Used to avoid directly controlling child/parent views. Decoupling! Pass an Action object to another view and inform that view if the action is available with the disable/enable functions. Using actions allows you to have duplicate controlsViews without having to directly maintain both in the content view (see patients problems list in the chart).
Constructor
awa.mvc.Action
-
[options.available] -
[options.type] -
[options.context] -
[options.method]
Parameters:
-
[options.available]Boolean optionaldefaults true
-
[options.type]String optionaldefaults undefined. Only use options in awa.mvc.Action.actionTypes
-
[options.context]Object optionalObject to call the method on
-
[options.method]Function optionalfunction to call on action
Methods
execute
()
Undefined
execute calls the method or calls it on the context if needed. do not override.
Returns:
isAvailable
()
Boolean
determines if the action is available
Returns:
flag
method
()
Undefined
method to call when action is taken. currently only used on buttons when clicked. this should be overridden or passed in through the constructor.
Returns:
setAvialable
-
available
sets availability of action and notifies listeners
Parameters:
-
availableBooleanFlag
Returns:
Properties
context
Unknown
object to call the method on.
type
String
See action types below. Use these to give hints as to how to style ui components
Default: undefined