SMART datagrid v.1 > Classes > TreeDataSet

Back  Forward

DataLudi.TreeDataSet.insertJsonRows  method

将包含相当于数据组字段的属性并可以通过指定的属性名称而包含子对象的JSON数组创建为树数据行之后, 将其插入在通过parent而指定的父行的index位置。 

为添加到父行的最后,将会使用appendJsonRows。 有关通过使用参数而构成树的方法,请参考setJsonRows。 

function insertJsonRows (parent: TreeDataRow, index: Integer, rows: Array, rowsProp: String, childRowsProp: String, currency: Boolean);
Returns
Void
Parameters
parent - TreeDataRow. required.
index - Integer. required.
rows - Array. required.
rowsProp - String. required.
childRowsProp - String. required.
currency - Boolean. required.
Code -1
    var rows = [{
        loan_number: 'IBRD00010', 
        country: 'Spain',
        interest_rate: 4.25,
        currency: 'USD',
        ...
        rows: [{
            loan_number: 'IBRD00030', 
            country: 'Denmark',
            ...
        }, {
            loan_number: 'IBRD00040', 
            country: 'Luxembourg',
            ...
        }]
    }];
    var row = treeMain.focusedDataRow();
    if (row) {
        var p = row.parent();
        dsMain.insertJsonRows(p, row.index(), rows, "", "rows");
    }
See Also
insertDataRows
setRows
appendDataRows
appendXmlRows
Examples
添加树数据
加载树数据
树数据组