title: How do I get the dirty records from an ExtJS data store?
body: <p>Other than iterating over the records in the store and checking the dirty flag, is there a cleaner way?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I am using ExtJS4, btw.</p>
  
  <p>Here is a snippet of the data returned.  Notice there is a <code>dirty: true</code> with the <code>modified</code> object set (which is actually the OLD data and the <code>data</code> object contains the NEW data)</p>
  
  <pre><code>data: Ext.Class.Class.newClass
      items: Array[3]
          0: Ext.Class.Class.newClass
              data: Object
                  incidentCount: 14
                  incidentKey: "5466BD05-E4DD-4C1F-9F73-61ABAC6D3753"
              dirty: true
              id: "Ext.data.Store.ImplicitModel-TEDetailIncidencesStore-ext-record-13"
              index: 0
              internalId: "ext-record-13"
              modified: Object
                  incidentCount: 7
  </code></pre>
  
  <p>Notice the <code>data</code> block contains an <code>incidentCount</code> of 14.  That is the <strong>NEW</strong> value and the <code>modified</code> block contains the <strong>OLD</strong> value of 7.</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>I load the store with:</p>
  
  <pre><code>TimeEntryDetailsStore.load({
       params:{
          timeEntryKey:"myKey"
       }
  });
  </code></pre>
  
  <p>After this fires, the above store is successfully loaded with 3 rows.  Then, when I change a value, the dirty flag is set and you get the above block of data</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT 3</strong></p>
  
  <p>This is the code I am going to use unless someone has a better way.  I don't understand why the <code>getUpdatedRecords()</code> returns an empty array.  But oh well.</p>
  
  <pre><code>for(c=0; c &lt; TEDetailIncidencesStore.count(); c++ ) {
      if( TEDetailIncidencesStore.data.items[c]["dirty"] == true) {
          var dirtyRecord = TEDetailIncidencesStore.data.items[c];
          updateTEDetailIncidences(dirtyRecord);
      }
  }
  </code></pre>