Я нашел причину (потерпите меня):
https://docs.sencha.com/extjs/6.0/6.0.2-classic/source/Controller2.html#Ext-app-Controller
посмотри на:
onClassExtended -> Controller.resolveNamespace -> Ext.app.getNamespace
Это важные из них, после разрешения пространства имен происходит вызов зависимостей процесса:
Controller.processDependencies(proto, requires, namespace, 'store', data.stores);
Я исследовал это, и Ext.app.getNamespace идентичен в ext 5 и 6.
так почему же это в ExtJs 5
Ext.getNamespace("MyApp.controller.SomeController"); // returns MyApp
и на ExtJs 6
Ext.getNamespace("MyApp.controller.SomeController"); // returns MyApp.controller
Причина найдена в console.log Ext.ClassManager.paths
теперь есть новая запись, соответствующая MyApp.controller
ранее не было ключа для MyApp.controller (ZHT.controller)
Ext.getNameSpace ищет «самый глубокий префикс», как вы можете видеть здесь http://docs.sencha.com/extjs/6.0/6.0.2-classic/source/Util.html#Ext-app-Util
[обновление] Итак, единственное, что можно сделать, это переопределить статический метод resolveNamespace следующим образом:
statics: {
resolveNamespace: function(cls, data) {
var Controller = Ext.app.Controller,
namespaceRe = cls.prototype.isProfile ? Controller.profileRegex : Controller.controllerRegex,
className, namespace, match;
/*
* Namespace resolution is tricky business: we should know what namespace
* this Controller descendant belongs to, or model/store/view dependency
* resolution will be either ambiguous or plainly not possible. To avoid
* guessing games we try to look for a forward hint ($namespace) that
* Application class sets when its onClassExtended gets processed; if that
* fails we try to deduce namespace from class name.
*
* Note that for Ext.app.Application, Controller.onClassExtended gets executed
* *before* Application.onClassExtended so we have to delay namespace handling
* until after Application.onClassExtended kicks in, hence it is done in this hook.
*/
className = Ext.getClassName(cls);
namespace = data.$namespace || data.namespace ||
Ext.app.getNamespace(className) ||
((match = namespaceRe.exec(className)) && match[1]);
//<debug>
if (!namespace) {
Ext.log.warn("Missing namespace for " + className + ", please define it "+
"in namespaces property of your Application class.");
}
//</debug>
//This is the only change on this override.
//http://stackoverflow.com/questions/37731213/extjs-6-stores-config-on-ext-app-controller-not-working/37733261#37733261
if(namespace && namespace.indexOf(".controller") > -1) {
namespace = namespace.slice(0, namespace.indexOf(".controller"));
}
return namespace;
}
}
Если вы знаете лучшее решение, пожалуйста, дайте мне знать!
person
code4jhon
schedule
09.06.2016
require
хранили в своем контроллере? В этом примере показано, что это необходимо: Ext. app.Controller#cfg-магазины. - person Robert Klein Kromhof   schedule 25.08.2016