DescriptionAllow data dependencies in data binding
Binding elements can indicate they depend on the values of
other model fields. An include test shows how this works.
In viewlets you can extend the bindings section of its configuration
to include 'depends'. A list of model attribute key names on which
this fields depends.
bindings: {
full: {
depends: ['first', 'last']
}
}
In this case we might indicate the computed value 'full' (name)
depends on first and last name stored in the model. Full Name
would be an attribute with a getter but doesn't fire change events
itself to trigger model updates. The attribute definition for 'full'
might be as follows:
full: {
getter: function() {return this.get('first') +
' ' + this.get('last');}
}
https://code.launchpad.net/~bcsaller/juju-gui/databinding-deps/+merge/172661
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 10
Patch Set 2 : Allow data dependencies in data binding #
MessagesTotal messages: 6
|