Skip to content

ImportFromXml

Sets the column values of the row from the child elements of an XML node.

1
myDataRow.ImportFromXml(node: Xml, mapper?: (this: DataRow, node: Xml) => void):void

Parameters

Xml node
    The XML node whose child elements contain the column values.

(this: DataRow, node: Xml) => void mapper optional
    A function to set values whose names differ from the column names. Inside the function, this is the row and the argument is node. Optional.

Remarks

Child elements are matched to columns by name. The table must belong to an Emakin data store.

Examples

Update a row from a form section

1
2
3
4
5
var customer = $Database.GetData('Sales', 'Customers', 'Id', $Xml.Evaluate('Customer/Id'))[0];

customer.ImportFromXml($Xml.SelectSingle('Customer'), function (node) {
    this.DisplayName = node.Evaluate('Name');
});