:: Home >>

defineModel

Creates get/set methods for the model/properties.

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

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

Comments will appear on this page and in the main forum.

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