SMART datagrid v.1 > Classes > GridDataSet

Back  Forward

DataLudi.GridDataSet.appendXmlRows  method

Except for transferring XML object to rows parameter, it is the same as appendRows

function appendXmlRows (rows: XMLList, start: Number, count: Number, rowEvents: Boolean): Integer;
Returns
Integer
Parameters
rows - XMLList. required.
start - Number. Defaults to 0.
count - Number. Defaults to -1.
rowEvents - Boolean. Defaults to false.
If it is true, confirmation and completion events will be fired in row units. If it is DataSet.undoable, events in row unit will not be fired regardless of this property.
Code -1
    // If rowEvents is false, the event will be fired when appending of all rows is committed.
    ds.onRowsInserted = function (ds, row, count) {
        console.log(row + '' + count + ' row has been appended in  th row location.';
    };
    // If rowEvents is true, the event will be fired whenever each row is appended.
    ds.onRowInserted = function (ds, row) {
        console.log(row + 'One row has been appended in  th row location.';
    };
    
    // rows parameter is XML object.
    // If the count is -1, it will append all rows of rows, and if it is greater than 0, it will append as much as Math.min(count, rows.length).
    //
    var rows = '<rows><row id="1" userid="smccoy" company="Fivespan" first_name="Jane"/><row id="2" userid="smccoy" company="Fivespan" first_name="Jane"/></rows>';
    rows = DataLudi.parseXml(rows).documentElement.childNodes;
    ds.appendXmlRows(rows, 0, -1, false);
See Also
insertXmlRows
updateXmlRows
setXmlRows
appendRows
Examples
Grid Data Set Edit