X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/src/grid/View.js diff --git a/src/grid/View.js b/src/grid/View.js index cb47756c..c1b52a6d 100644 --- a/src/grid/View.js +++ b/src/grid/View.js @@ -72,15 +72,22 @@ Ext.define('Ext.grid.View', { this.doStripeRows(index); }, + onUpdate: function(ds, record, operation) { + var index = ds.indexOf(record); + this.callParent(arguments); + this.doStripeRows(index, index); + }, + /** * Stripe rows from a particular row index * @param {Number} startRow + * @param {Number} endRow Optional argument specifying the last row to process. By default process up to the last row. * @private */ - doStripeRows: function(startRow) { + doStripeRows: function(startRow, endRow) { // ensure stripeRows configuration is turned on if (this.stripeRows) { - var rows = this.getNodes(startRow), + var rows = this.getNodes(startRow, endRow), rowsLn = rows.length, i = 0, row; @@ -89,8 +96,9 @@ Ext.define('Ext.grid.View', { row = rows[i]; // Remove prior applied row classes. row.className = row.className.replace(this.rowClsRe, ' '); + startRow++; // Every odd row will get an additional cls - if (i % 2 === 1) { + if (startRow % 2 === 0) { row.className += (' ' + this.altRowCls); } }