:: Documentation >>

defineModel

Creates get/set methods for the model/properties.

null

Syntax

obj.defineModel(name, [properties]);

Parameters

name (string) - model names
optional properties (array) - model properties name/value pairs

Example

The folowing example creates 'cell data model' with two properties - text and color.

obj.defineModel("cell", {text: "", color: "black"});
obj.setCellText("some text")'
var color = obj.getCellColor();

The defineModel() call creates the get/setCellText() and get/setCellColor() methods.

See also

getModel, setModel methods

Comments

BUG in Model definition : Alex ? Yasdnil (3)
How do template display model data Yasdnil (0)
Hooking setter in defineProperty() LostInSpace (4)

Documentation:

Recent changes:

2.6.4
2.6.3
2.6.2
2.6.1
2.6.1
2.6.0
2.5.0 - 2.5.6
2.5.6
2.5.0 - 2.5.5
2.5.5