Iterating over records in an ExtJS store and filtering on a specific field <p>I am iterating over records in a store as they come in like so:</p> <pre><code>Ext.create('Ext.data.Store', { model: 'Message', storeId: 'Staging', proxy: { type: 'memory', reader: { type: 'json' } }, listeners: { add: function(store, records, index, eOpts){ if (!Ext.data.StoreManager.lookup('Historical').isLoading()) { this.each(function(item, index, count) { if(item.notificationType === 'INBOX'){ // populate inbox store // increment the unread inbox count console.log('inbox'); } else if (item.notificationType === 'NOTIFICATION') { // populate notifications store // increment the unread notification count } }); // no historical data should be held in memory for performance this.removeAll(); } } } }); </code></pre> <p>The <em>item.notificationType</em> property returns undefined.</p> <p>I have tried other properties but they also return undefined.</p> <p>I need to perform different actions when different types are encountered and thought this would do it!</p> <p>So the item is a record in the store which contains json in the structure as follows:</p> <pre><code> { "source":"2", "target":"1416529", "sourceType":"USER", "redirectUrl":null, "message":"cow's go...", "id":606, "targetType":"TEAM", "messageType":"TIBRR_WALL_MESSAGE", "notificationType":"INBOX", "sentDate":1356599137173, "parameters":null, "targetId":"1416529", "sourceId":"2", "dispatched":true, "read":false, "readDate":null, "dispatchedDate":1356599137377 } </code></pre>