Module: defaultView

defaultView

new require("defaultView")() → {function}

Default widget view class
Source:
See:
Requires:
Returns:
Backbone.View constructor
Type
function
Source:

Methods

afterRender()

Generally is used once for event bindings and similar things, so this method might be removed right after the call
Source:

errorCb()

error model fetch callback
Source:

fetch()

The simplest model fetch
Source:

initialize()

Triggers model creation and self property definition
Source:

initRelatedView() → {object|undefined}

Provides internal view initialization and stores object as parent view property
Source:
Returns:
Related view instance
Type
object | undefined

ModelConstructor()

Default model constructor
Source:
See:

modelInit(ext, Model, name, attr)

Creates related model instance
Parameters:
Name Type Argument Description
ext Object Class extension object
Model function <optional>
Model class constructor. Equals this.ModelConstructor if undefined
name String <optional>
Inner model property name. "model" if undefined
attr Object <optional>
Attributes
Source:

render() → {object}

Render template and append to DOM .render() also calls this.update() after.
Source:
Returns:
view current view instance
Type
object

renderData()

renderData "placeHolder"
Source:

renderMenu(list) → {boolean}

Renders static link list (widget mode switcher)
Parameters:
Name Type Description
list Array Menu elements
Source:
Returns:
Is there a menu in view.$el
Type
boolean

renderTitle(title)

Renders widget title Actually title can be placed in template, but in this case it couldn't be changed after without full widget re-render
Parameters:
Name Type Argument Description
title <optional>
New widget title
Source:

selectMenuItem()

Menu link state indicator
Source:

setMode(arg) → {object|boolean}

Updates widget .mode property. It's pretty close to the validation too
Parameters:
Name Type Description
arg object | number | string Mode object or plain arguments
Source:
Returns:
Mode object or false
Type
object | boolean

setProgressIndicator(status) → {number}

Widget background ajax-loader.gif toggle
Parameters:
Name Type Argument Description
status Number <optional>
Widget status code or this.status if undefined
Source:
Returns:
View status code
Type
number

showMessage() → {string|*}

showMsg alias
Source:
See:
Returns:
Message text
Type
string | *

showMsg(msg) → {string|*}

In-view message display. For errors, alerts, etc.
Parameters:
Name Type Argument Description
msg String <optional>
Message or message code. If !msg == true the box will be hidden
Source:
Returns:
Message text
Type
string | *

successCb()

success model fetch callback
Source:

switchModeDelayed(arg) → {boolean}

Schedules widget mode change
Parameters:
Name Type Description
arg * Any argument
Source:
Returns:
Is delayed set supported
Type
boolean

switchRelatedView($target) → {object|boolean}

Switches widget inner views
Parameters:
Name Type Description
$target Object View.$el to activate
Source:
Returns:
View.$el or false
Type
object | boolean

update()

Model data updater
Source: