APIs

Show:

Singleton object for underscore templates. Underscore tempalte files end with htm, jtml files end in html. Dont use JTML

both renderModelDisplay and renderModelInput accept an array of attributes that you want rendered. you can pass a string for the attribute id or an object with atleast the id property specified to match the attribute id. Anything else you dont provide, the generator will try and pull from the model.

attributes
{
    id: //attribute id (i.e. pat_fname)
    displayMethod: //takes parameters in this order (value, attribute_id, model). should return a string or element
    className: //applied to the attribute field's class attribute (usually a tr or div)
    displayClassName: //applied to the attribute display element's class attribute (usually a span or td)
    headerClassName: //applied to the attribute header element's class attribute (th or label)
    inputClassName:
    errorClassName:
}

Methods

get

(
  • name
)
Function

Parameters:

  • name String

    name of template.

Returns:

Function:

returns a compiled template.

getTemplate

(
  • name
)
String

Parameters:

  • name String

    name of template.

Returns:

String:

template contents

has

(
  • name
)
Boolean

Parameters:

  • name String

    name of template.

Returns:

Boolean:

true if it exists

render

(
  • name
  • args
)
String

Parameters:

  • name String

    name of template.

  • args Object

    name of template.

Returns:

String:

html string

renderButton

(
  • args
)
String

Parameters:

  • args Object

    configuration object with various properties

    • [contents] Object optional

      html contents of the button (icons, text, etc.)

    • [icon] Object optional

      html contents of the button (icons, text, etc.)

    • [type] Object optional

      button widget type, decides the color

    • callback String

      data-events string. either a function name, or an event type followed by a colon and then a function name.

Returns:

String:

html string

renderInput

(
  • args
)
String

Parameters:

  • args Object

    configuration object with various properties

    • [contents] Object optional

      html contents of the button (icons, text, etc.)

    • [icon] Object optional

      html contents of the button (icons, text, etc.)

    • [type] Object optional

      button widget type, decides the color

    • callback String

      data-events string. either a function name, or an event type followed by a colon and then a function name.

Returns:

String:

html string

renderModelDisplay

(
  • args
)
String

attributes { id: type: not in use yet displayMethod: href: className: displayClassName: headerClassName: }

Parameters:

  • args Object

    configuration object with various properties

    • model Model

      name of template.

    • [attributes] Array optional

      selected attributes in the order to be rendered

    • [tpl] String | Function optional

      name of template.

Returns:

String:

html string

renderModelInput

(
  • args
)
String

Parameters:

  • args Object

    configuration object with various properties

    • model Model

      name of template.

    • [title] String optional

      selected attributes in the order to be rendered

    • [attributes] Array optional

      selected attributes in the order to be rendered

    • [tpl] String | Function optional

      name of template.

Returns:

String:

html string

renderModelInputBlock

(
  • config
)
String deprecated

Parent views should check this before changing/swapping a view. Useful for views that are in edit mode that you want to do confirmation before leaving.

Parameters:

  • config Object

    configuration object with various properties

    • [model] Object optional

      Source Model

    • attributes Object

      Array of strings or objects. An object and provide extra features as needed but requires 'attribute' property to outline which it is.

Returns:

String:

Literal lies

renderSelect

(
  • args
)
String

Parameters:

  • args Object

    configuration object with various properties

    • collection Array | awa.mvc.Collection

      Source collection

    • collectionID String | Function

      selected attributes in the order to be rendered

    • collectionValue String | Function

      name of template.

    • [defaultID] String optional

      Default id, usually a blank space

    • [defaultValue] String optional

      Delect display, "Select {blah}..."

    • [selectedID] String optional

      Value to start the select on

Returns:

String:

html string

Properties

templates

Unknown

holds the uncompiled version of the templates

templatesCompiled

Unknown

holds the compiled version of the templates