SMART datagrid v.1 > Classes > TreeDataSet

Back  Forward

DataLudi.TreeDataSet.insertXmlRows  method

It creates XMLList object or XML string which contains properties corresponding to data set fields and can contain the array of child objects as specified property name as tree data rows, and inserts in index location of parent row specified by parent

In order to append to the end of parent row, it will use appendXmlRows. Please refer to setXmlRows about the way of organizing the tree by using parameters. 

function insertXmlRows (parent: TreeDataRow, index: Integer, rows: String|XMLList, rowsProp: String, childRowsProp: String, currency: Boolean);
Returns
Void
Parameters
parent - TreeDataRow. required.
index - Integer. required.
rows - String|XMLList. required.
rowsProp - String. required.
childRowsProp - String. required.
currency - Boolean. required.
Code -1
    // It is the same as below call.
    ds.insertXmlRows(parent, parent.count(), rows, rowsProp, childRowsProp, currency);
Code -2
    var rows 
    = "<rows>"
    +       "<row>"
    +           "<icon>0</icon><loan_number>IBRD00010</loan_number><country>Spain</country>"
    +           "<rows>"
    +               "<row>"
    +                   "<icon>1</icon><loan_number>IBRD00030</loan_number><country>Denmark</country>"
    +               "</row>"
    +               "<row>"
    +                   "<icon>2</icon><loan_number>IBRD00040</loan_number><country>Luxembourg</country>"
    +               "</row>"
    +           "</rows>"
    +       "<row>"
    + "</rows>";
    var row = tree.focusedDataRow();
    if (row) {
        var p = row.parent();
        ds.insertXmlRows(p, row.index(), rows, 'row', 'rows');
    }
See Also
appendXmlRows
setRows
appendDataRows
appendJsonRows
Examples
Append Tree Data
Load Tree Data
Tree Data Set