Constructor
new BindingUtil()
- Source:
Examples
Add Binding:
BindingUtils.addBinding(srcele, "value", "change", destele, "value", false);
Remove Binding :
BindingUtils.removeBinding(srcele, "value");
Chain Binding :
DOM Element -> JavaScript Object (or DOM) -> DOM Element (or Javascripg Object)
1) DOM Element -> JavaScript Object :
BindingUtils.addBinding(srcele, "value", "change", this.myCustomModel, "setValue", false);
2) JavaScript Object -> DOM Element :
BindingUtils.addBinding(this.myCustomModel, "getValue", "change", destele, "value", false);
Two-way Binding :
BindingUtils.addBinding(srcele, "value", "change", destele, "value", true);
Classes
Methods
addBinding(srcObj, srcProp, evtname, targObj, targProp, twoway)
- Source:
- Add Binding method binds Source Object property with Target Object Property with Synchronize on SourceObject Event
Example
Add Binding :
BindingUtils.addBinding(srcele, "value", "change", destele, "value", false);
Parameters:
Name | Type | Description |
---|---|---|
srcObj |
object | Source DOM Element or Object |
srcProp |
string | Source Property |
evtname |
string | Source Object EventName on which Binding Trigger |
targObj |
object | Target DOM Element or Object |
targProp |
string | Target Property |
twoway |
Boolean | True when Binding is Two-way |
removeBinding(_srcObj, _evtname)
- Source:
- Add Binding method binds Source Object property with Target Object Property with Synchronize on SourceObject Event
Example
Remove Binding :
BindingUtils.removeBinding(srcele, "value");
Parameters:
Name | Type | Description |
---|---|---|
_srcObj |
object | Source DOM Element or Object |
_evtname |
string | Source Object EventName on which Binding Trigger |