SMART datagrid v.1 > Classes > TreeDataSet

Back  Forward

DataLudi.TreeDataSet.appendXmlRows  method

将包含相当于数据组字段的属性并可以通过指定的属性名称而包含子对象的XMLList对象或XML字符串创建为树数据行之后, 将其添加到通过parent而指定的父行的最后。 

为插入在中间位置,将会使用insertXmlRows。 有关通过使用参数而构成树的方法,请参考setXmlRows。 

function appendXmlRows (parent: TreeDataRow, rows: String|XMLList, rowsProp: String, childRowsProp: String, currency: Boolean);
Returns
Void
Parameters
parent - TreeDataRow. required.
rows - String|XMLList. required.
rowsProp - String. required.
childRowsProp - String. required.
currency - Boolean. required.
Code -1
    // 如同下列调用。
    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 = treeMain.focusedDataRow();
    if (row) {
        ds.appendXmlRows(row, rows, 'row', 'rows');
        tree.expand(tree.focusedRow());
        row = row.getChild(row.count() - 1);
        row = tree.getRowOfDataRow(row);
        tree.expand(row, true);
        tree.setFocusedRow(row);
    }
See Also
insertXmlRows
setRows
appendDataRows
appendJsonRows
Examples
添加树数据
加载树数据
树数据组