SpreadJS Documentation
getDirtyRows Method
Gets the dirty row collection.
Syntax
var instance = new GcSpread.Sheets.Sheet(name);
var value; // Type: Array
value = instance.getDirtyRows();
function getDirtyRows() : Array;

Return Value

The dirty rows.

The following values can be returned:

row.row number type Specifies row index.
row.item object type Specifies data item of the row.
row.originalItem object type Specifies original data item of the row.
Example
This example gets the dirty rows.
var customers = [
               { ID: 0, Name: 'A', Info1: 'Info0' },
               { ID: 1, Name: 'B', Info1: 'Info1' },
               { ID: 2, Name: 'C', Info1: 'Info2' },
            ];
            activeSheet.autoGenerateColumns = true;
            activeSheet.setDataSource(customers);



$("#button1").click(function () {
var dirtyRows = activeSheet.getDirtyRows();
            var len = dirtyRows.length;
            if (len > 0) {
                for (var i = 0; i < len; i++) {
                    var dr = dirtyRows[i];
                    alert("row:" + dr.row);
}
}
   });

// Add a button to the page
<input type="button" id="button1" value="button1"/>
See Also

Reference

Sheet type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.