Skip to content

$NewChild

Represents the XML element for a new child item while a list item's initialization script is running.

1
const $NewChild: Xml;

Remarks

This variable is available only in the list's new-child initialization context. It provides access to the pending item's XML structure, allowing default values to be set before the item is added to the list.

Setting a default value for a field in the new child item

1
$NewChild.SetValue('MyField', $Xml.Evaluate('$poolRoot/MyField'));

Capabilities

Namespaces

Structure Changes

  • $NewChild.AppendChild: Appends a new child to the specified XPath location and executes the provided callback function on the newly created node before inserting it into the DOM. Returns the appended new node.
  • $NewChild.Copy: Copies the current XML node and all its child nodes from the source XPath to the target XPath or target navigator.
  • $NewChild.Remove: Removes the current node and returns it in an array.
  • $NewChild.Sync: Synchronizes the nodes at the specified XPath with the input nodes, and returns an array of the synchronized nodes.

Validation and Cleanup

  • $NewChild.Assert: Performs an error check by asserting that the specified XPath evaluates to a boolean true value. If the assertion fails, an error is thrown.
  • $NewChild.CommitDeletes: Deletes all child nodes that have the State attribute set to the value 'Deleted'.

Client Events

  • $NewChild.Bind: Attaches a change event handler to the nodes selected by the specified XPath.
  • $NewChild.Live: Attaches a change event handler to the specified XPath.
  • $NewChild.Trigger: Triggers event handlers bound to the current node.

Reading and Predicates

Creation and Persistence

Formatting and Transformation

Attributes

Selection and Navigation

Value Updates