Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

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

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

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

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

Arguments

(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.

Example

Receive an alert for changing a node

Code Block
languagejs
var isNameEmpty = $Xml.Bind('//Customer/Name', function() {
alert('Customer name is changed');
});

Example

Receive an alert for any change on current document

Code Block
languagejs
$Xml.Bind(function() {
  alert( this.LocalName() + ' is changed.');
});