PDA

View Full Version : Ext.syncRequire does not fire callback function



kkris1983
27 Apr 2012, 2:49 AM
Hi,

We use Ext JS v.4 and we face an issue when we specify list of classes to be downloaded but fallback function does not fire nor any error appear in console/network tab. It happens from time to time and we are not able to find a reason. I would appreciate any help.

Best regards kkris1983

mitchellsimoens
1 May 2012, 7:12 AM
Are you using MVC?

kkris1983
1 May 2012, 1:20 PM
Yes, I do.

mitchellsimoens
2 May 2012, 4:00 AM
Yes, I do.

Then you don't even need to worry about syncRequire as when yo ugo to deploy your app you will be doing a build which will take everything and put it into one JS file.

kkris1983
8 May 2012, 12:08 AM
The thing is it does not work as intended. We face that issue only in Chrome. We have static stores - available for whole application. These stores are loaded by us during Ext.application initialisation. We noticed that when let ExtJS handle stores and its models download, very often app hanged(because of missing model) when store tried to load its data. The strange thing was that model's file.js had been downloaded at that time. That is why we decided to do that manually by calling Ext.syncRequire and waiting with store.load() call untill all models are loaded. That way we reduced occurence of that error, but we faced another one, which is... Ext.syncRequire callback does not fire from time to time, and our app hangs. And again it is strange because we do not see any error in network tab/developer tools. I would like to emphasize that it only happens in chrome.

Any ideas ?
Best regards kkris1983