ModelReference

Class representation of a model instance.

Summary
Class representation of a model instance.
This event fires when a change has been made in the model.
Creates an instance of the mojo.ModelReference class
Retrieves the model key.
Retrieves the data stored in the model.
Sets new data to be stored in the model.

Events

onNotify

This event fires when a change has been made in the model.

Functions

constructor

constructor: function(key)

Creates an instance of the mojo.ModelReference class

Parameters

key{string}

Example

// instantiate a new ModelReference
var model = new mojo.ModelReference("testModel");

getKey

getKey: function()

Retrieves the model key.

Returns

{string} Mojo Model Key

getValue

getValue: function()

Retrieves the data stored in the model.

Returns

{object} Mojo Model

setValue

setValue: function(valueObj)

Sets new data to be stored in the model.

Parameters

valueObj{object}
constructor: function(key)
Creates an instance of the mojo.ModelReference class
getKey: function()
Retrieves the model key.
getValue: function()
Retrieves the data stored in the model.
setValue: function(valueObj)
Sets new data to be stored in the model.