API Docs for:
Show:

BindingDescriptor Class

Describes a binding which can be used in bindings-property of a component. Data-Bindings supporting many advanced features but is recommended instead of trying to build complex controls with complicated binding-expressions to just write an own component.

Properties

breakChain

String

Contains one or multiple IDs of controls which will break the binding-chain to avoid an endless circular changing of values. For example, if one binding changes a property of control A and then control A trigger a binding to change a property of control B which then will trigger again a change of a property of control A which results in and endless chain.

condition

ConditionDescriptor

Defines a condition which must be true before the binding can be executed.

conditions

ConditionDescriptor[]

Defines conditions which must be true before the binding can be executed.

convertRatio

BindingRatioConversionDescriptor

Defines a ratio-conversion. Sometimes it is necessary to convert a value from one value-space to another. An example could be a volume slider control where the slider-knob moves vertically between 0 - 500 pixels but its value should be stored between 0 and 100. In that case it is necessary to convert the knobs y-coordinate(0 - 500) into the volume value-space (0 to 100) before writing to target-field.

The above example can be done with the following ration-conversion:

{... "sourceField": "$slider_knob.dstRect.y", "targetField": "$dataFields.settings.generalMusicVolume", "convertRatio": { "target": 100, "source": 500 } ... }

The actual internal formula used for ratio-conversion is:

targetField = (convertRatio.target - convertRatio.targetSize) / (sourceField - convertRatio.sourceSize) * (source-field - value-offset) + offset

So there are some other properties available to give more control about the ratio-conversion. Check BindingRatioConversionDescriptor for more information.

event

EventDescriptor

The binding can only be executed if the defined event is true

events

EventDescriptor[] |

The binding can only be executed if the defined events are true

max

String | Number

A binding-expression to define a max-value the source-field is limited to before written into the targetField.

min

String | Number

A binding-expression to define a min-value the source-field is limited to before written into the targetField.

negateValue

Boolean

If true the source-value will be negated before written into the target-field.

roundMethod

String | Number

Defines if and how the source-value should be rounded before written into the target-field. Can be "round", "floor" or "ceil".

sourceField

String

A binding-expression to define the source-value.

targetField

String

A binding-expression to define the target-field.