Copyright © 2021 by K4.org
  (v.0.48.124)

Hierarchy

Index

Properties

Readonly deleteModelRules

deleteModelRules: function

Removes all model rules on model and below. This removes all model rules where the owner refchain starts with model.refChain -- even if models with matching refChains no longer exist. NOTE: The deletion happens AFTER the current evaluation ends. During this evaluation, all of the rules to be deleted still exist.

param

The model we starting from

Readonly import

import: function

Imports the model into the current tree. NOTE: The model is imported AFTER the current evaluation ends. It is not possible to reference the resulting model during this evaluation. All Rule event triggers are suppressed during this operation.

param

The model definition string, as produced by export.

param

The name of the branch of the resulting import.

param

The refChain of the location in the tree which will be the 'parent' of the imported model.

example

R.model.import(this.modeldata, 'newChild', this.refChain)

Readonly isBound

isBound: function

Returns true if model.ruleName is bound to a value. Returns false if there is no such rule on model. Does not create a dependency on ruleName.

param

The model which owns ruleName.

param

The name of the rule we whose binding state is desired.

Readonly lookup

lookup: function

Performs the lookup operation. This is called from inside Lookup rules.

param

The model we are looking up from

param

The name of the rule we are looking up

Readonly sort

sort: function

Sorts a list of models by given criteria, returning a shallow copy. R.model.sort(models, ruleName, sortFunction?) => new list of models, sorted The rule should produce a string or a number unless a custom sort function is supplied. If not supplied, the sort function will produce an ascending ordering, according to type, case-insensitve for strings. The rule will be evaluated on each model only once, before any sorting has started.

It will throw exceptions if:

  • All of the items in models are not models
  • There is no rule of the given name on the models.
  • The result of evaluating the sort function on the rule results in an exception.

Readonly storeValue

storeValue: function

Creates a model rule containing value and adds it to model. NOTE: The rule is added AFTER the current evaluation ends. It is not possible to reference the resulting value during this evaluation.

param

The model to get the new rule.

param

The name of the new (or override) rule.

param

The value to store. This must be a type which has a literal definition.

example

R.model.storeValue(this.myChild, 'foo', 42)