Binding$Typings extension
Properties
-
backConverter
↔ BackConversion?
-
Gets or sets a converter function to apply to the GraphObject property value
in order to produce the value to set to a data property.
This conversion function is only used in a TwoWay binding,
when transferring a value from the target to the source.
The default value is null -- no conversion takes place.
Otherwise the value should be a function that takes one or two arguments
and returns the desired value.
However, the return value is ignored when the #sourceProperty
is the empty string.
getter/setter pair
-
converter
↔ TargetConversion?
-
Gets or sets a converter function to apply to the data property value
in order to produce the value to set to the target property.
This conversion function is used in both OneWay and TwoWay bindings,
when transferring a value from the source to the target.
The default value is null -- no conversion takes place.
Otherwise the value should be a function that takes one or two arguments
and returns the desired value.
However, the return value is ignored when the #targetProperty
is the empty string.
getter/setter pair
-
isToModel
↔ bool
-
Gets or sets whether the source data is Model#modelData rather than a node data or link data object in the model.
The default value is false -- the source data object will not be the shared Model.modelData object.
getter/setter pair
-
mode
↔ EnumValue
-
Gets or sets the directions and frequency in which the binding may be evaluated.
The default value is Binding.OneWay.
Binding.TwoWay is the other choice.
getter/setter pair
-
sourceName
↔ String?
-
Gets or sets the name of the GraphObject that should act as a source object
whose property should be gotten by this data binding.
The default value is null, which uses the bound Panel#data as the source.
If the value is a string, it should be the name of a GraphObject in the
visual tree of the Panel that is bound to the data.
Use the empty string to refer to the root panel, which is typically the whole Node or Link,
but will be a Panel if used in a Panel#itemTemplate.
The name must not contain a period.
getter/setter pair
-
sourceProperty
↔ String
-
Gets or sets the name of the property to get from the bound data object,
the value of Panel#data.
The default value is the empty string, which results in setting the target
property to the whole data object, rather than to a property value of the data object.
If #sourceName is not null, then this property names the settable
property on the GraphObject or RowColumnDefinition
that acts as the source.
getter/setter pair
-
targetProperty
↔ String
-
Gets or sets the name of the property to be set on the target GraphObject.
The default value is the empty string; you should set this to be the name of a property.
getter/setter pair
Methods
-
copy()
→ Binding
-
Create a copy of this Binding, with the same property values.
@expose
@return {Binding}
-
makeTwoWay([BackConversion? backconv])
→ Binding
-
Modify this Binding to set its #mode to be Binding.TwoWay, and
provide an optional conversion function to convert GraphObject property
values back to data values, as the value of #backConverter.
-
ofModel()
→ Binding
-
Modify this Binding so that the source is the Model#modelData object,
not a regular node data object or another GraphObject in the Part.
@return {Binding} this Binding to the Model#modelData object.
@see #isToModel
@see #ofObject
@since 1.7
-
ofObject([String? srcname])
→ Binding
-
Modify this Binding to set its #sourceName property so as to identify
a GraphObject in the visual tree of the bound Panel as the data source,
instead of the Panel#data as the data source.