Skip to content

Bind

Attaches a change event handler on the specified xpath resulting nodes.

1
myXml.Bind(callback: (e: XmlEvent) => void):void

Attaches a change event handler on the specified xpath resulting nodes.

1
myXml.Bind(xpath: string, callback: (e: XmlEvent) => void):void

Parameters

(e: XmlEvent) => void callback
    Callback function to be executed.

string xpath
    XPath of nodes to be attached. If not specified, the current node is selected.

Remarks

This method is only available on the client side scripts like Form scripts.
Bind method only attaches to an already existing nodes. To receive notifications for existing and nodes created in the future, please use Xml.Live method.
This method is only available on the client side scripts like Form scripts.
Bind method only attaches to an already existing nodes. To receive notifications for existing and nodes created in the future, please use Xml.Live method.

Receive an alert for changing a node

1
2
3
var isNameEmpty = $Xml.Bind('//Customer/Name', function() {
  alert('Customer name is changed');
});

Receive an alert for any change on current document

1
2
3
$Xml.Bind(function() {
  alert( this.LocalName() + ' is changed.');
});

See Also