PDA

View Full Version : [INFOREQ] [2.1.0] Two stores - one model, second store never loads records.



stefankendall
8 Nov 2012, 8:40 AM
I have two stores with the same model. The second store is a filtered view of the first store, but the first store is used in different places sans filter to back lists and perform operations.

In ST2.0.0, calling 'load' on both stores caused each to be populated. In ST2.1.0, the second store is never populated with records, and is always empty.

mitchellsimoens
8 Nov 2012, 11:11 AM
Can I get a test case that I can run?

Used this model:


Ext.define('MyModel', {
extend : 'Ext.data.Model',

config : {
fields : ['foo']
}
});

and these stores and both have data:


var store1 = new Ext.data.Store({
autoLoad : true,
model : 'MyModel',
proxy : {
type : 'ajax',
url : 'data/json.json'
},
listeners : {
load : function (store, recs) {
console.log('store 1');
console.log(store);
}
}
});

var store2 = new Ext.data.Store({
autoLoad : true,
model : 'MyModel',
proxy : {
type : 'ajax',
url : 'data/json.json'
},
listeners : {
load : function (store, recs) {
console.log('store 2');
console.log(store);
}
}
});