PDA

View Full Version : [ext-4.2.2.1144] Store is loaded twice if autoLoad and remoteSort is set to TRUE



vot
9 Jan 2014, 3:11 AM
A store is loaded twice during object construction if autoLoad and remoteSort is set to TRUE.

1)

Ext.define('Ext.data.AbstractStore', {
applyState: function(state) {
...
if (me.autoLoad && (me.remoteSort || me.remoteGroup || me.remoteFilter)) {
if (me.autoLoad === true) {
me.reload();
} else {
me.reload(me.autoLoad);
}
}

2)

Ext.define('Ext.data.Store', {
constructor: function(config) {
...
else if (me.autoLoad) {

Ext.defer(me.load, 1, me, [ typeof me.autoLoad === 'object' ? me.autoLoad : undefined ]);
}

I assume the code in Ext.data.Store should be look like below to prevent loading the store twice while construction time.


Ext.define('Ext.data.Store', {
constructor: function(config) {
...
else if (me.autoLoad) {
if (!(me.remoteSort || me.remoteGroup || me.remoteFilter)) {
Ext.defer(me.load, 1, me, [ typeof me.autoLoad === 'object' ? me.autoLoad : undefined ]);
}
}

Gary Schlosberg
9 Jan 2014, 5:10 AM
Thanks for the report. This sounds like this known issue:
http://www.sencha.com/forum/showthread.php?264958

If you believe it to be a separate problem, please post a test case which reproduces the issue.

vot
9 Jan 2014, 5:20 AM
You're right, it's duplicate to EXTJSIV-10029. Maybe the mentioned code above will fix this problem.