X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/docs/source/View.html diff --git a/docs/source/View.html b/docs/source/View.html index c83ae344..b13343eb 100644 --- a/docs/source/View.html +++ b/docs/source/View.html @@ -1,4 +1,21 @@ -Sencha Documentation Project
/**
+
+
+
+  
+  The source code
+  
+  
+  
+  
+
+
+  
/**
  * @class Ext.grid.View
  * @extends Ext.view.Table
 
@@ -34,7 +51,7 @@ Ext.define('Ext.grid.View', {
     extend: 'Ext.view.Table',
     alias: 'widget.gridview',
 
-    /**
+    /**
      * @cfg {Boolean} stripeRows <tt>true</tt> to stripe the rows. Default is <tt>false</tt>.
      * <p>This causes the CSS class <tt><b>x-grid-row-alt</b></tt> to be added to alternate rows of
      * the grid. A default CSS rule is provided which sets a background color, but you can override this
@@ -45,7 +62,7 @@ Ext.define('Ext.grid.View', {
     
     invalidateScrollerOnRefresh: true,
     
-    /**
+    /**
      * Scroll the GridView to the top by scrolling the scroller.
      * @private
      */
@@ -72,15 +89,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 +113,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);
                 }
             }
@@ -107,4 +132,6 @@ Ext.define('Ext.grid.View', {
         }
     }
 });
-
\ No newline at end of file +
+ +