APIs

Show:

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 optional

    defaults true

  • [options.type] String optional

    defaults undefined. Only use options in awa.mvc.Action.actionTypes

  • [options.context] Object optional

    Object to call the method on

  • [options.method] Function optional

    function to call on action

Item Index

Properties

Methods

execute

() Undefined

execute calls the method or calls it on the context if needed. do not override.

Returns:

Undefined:

isAvailable

() Boolean

determines if the action is available

Returns:

Boolean:

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:

Undefined:

setAvialable

(
  • available
)
Undefined

sets availability of action and notifies listeners

Parameters:

  • available Boolean

    Flag

Returns:

Undefined:

Properties

type

String

See action types below. Use these to give hints as to how to style ui components

Default: undefined