var pmStore = new storeOfUsers(); // storeOfUsers is an Ext.data.DirectStore with autoLoad: true
console.log(pmStore.data); // is an Ext.util.MixedCollection with 6 items including user_id == 1
var pms = pmStore.data.filter('user_id', 1);
console.log(pms); //is an Ext.util.MixedCollection with length == 0
Hello.
After filtering MixedCollection the returned collection is empty although there is a result with user_id == 1. Have I missed something?
Thanks.
My guess is that the problem is the asynchronous loading of the store.
You are probably filtering the store before it was loded. I had instances in the past where console.log() shows incorrectly the synchronous data (as if the log is updated once the call completed).
I’d try to cancel autoload, and do a manual load instead with a callback where you filter the data.