同步加载考虑在Ext.onReady上面添加Ext.require(...)

时间:2015-01-26 18:00:35

标签: extjs extjs5

我已阅读thisthisthisthis,但未提供解决方案。

我使用sencha cmd生成了一个基本应用程序。

我创建了一个模型“Groupe.js”,一个商店“TreeGroupes.js”,它是“Groupe.js”行的“集合”(对不起,如果我没有使用正确的词,我希望你知道我的意思)。 然后我创建了这个集合的视图:Gestion.view.TreeGroupes。我在主控制器视图/ main / Main.js中显示它。

这是树:

.
├── Application.js
├── model
│ ├── Groupe.js
│ └── Readme.md
├── Readme.md
├── store
│ ├── Readme.md
│ └── TreeGroupes.js
└── view
├── main
│ ├── MainController.js
│ ├── Main.js
│ └── MainModel.js
└── TreeGroupes.js

所以这是我的逻辑:

  • view/main/Main.js只需Gestion.view.TreeGroupes,因此我只在此文件的“Gestion.view.TreeGroupes”配置中添加“requires”;
  • view/TreeGroupes.js需要Gestion.store.TreeGroupes,因此我只在此文件的“Gestion.store.TreeGroupes”配置中添加“requires”;
  • store/TreeGroupes.js需要Gestion.model.Groupe才能获取数据,因此我只在此文件的“Gestion.model.Groupe”配置中添加“requires”。

它一直在告诉我这两个警告:

[W] [Ext.Loader] Synchronously loading 'Gestion.view.TreeGroupes'; consider adding Ext.require('Gestion.view.TreeGroupes') above Ext.onReady

[W] [Ext.Loader] Synchronously loading 'Gestion.store.TreeGroupes'; consider adding Ext.require('Gestion.store.TreeGroupes') above Ext.onReady

2 个答案:

答案 0 :(得分:0)

尝试将TreeGroupes添加到MainController.js

views config

答案 1 :(得分:0)

找不到解决方案,所以我必须阅读文档并尝试sencha app watch

root@mycomputer:/web/htdocs/bigpath/myapp# sencha app watch
Sencha Cmd v5.1.0.26
[INF] Processing Build Descriptor : default
[INF] Loading app json manifest...
[INF] Appending content to /web/htdocs/bigpath/myapp/bootstrap.js
[INF] Writing content to /web/htdocs/bigpath/myapp/bootstrap.json
[INF] merging 219 input resources into /web/htdocs/bigpath/myapp/build/development/Gestion/resources
[INF] merged 0 resources into /web/htdocs/bigpath/myapp/build/development/Gestion/resources
[INF] merging 0 input resources into /web/htdocs/bigpath/myapp/build/development/Gestion
[INF] merged 0 resources into /web/htdocs/bigpath/myapp/build/development/Gestion
[INF] writing sass content to /web/htdocs/bigpath/myapp/build/temp/development/Gestion/sass/Gestion-all.scss.tmp
[INF] appending sass content to /web/htdocs/bigpath/myapp/build/temp/development/Gestion/sass/Gestion-all.scss.tmp
[INF] appending sass content to /web/htdocs/bigpath/myapp/build/temp/development/Gestion/sass/Gestion-all.scss.tmp
[INF] executing compass using system installed ruby runtime
unchanged Gestion-all.scss
[INF] Mapping http://localhost:1841/ to /web/htdocs/bigpath/myapp...
[INF] ------------------------------------------------------------------
[INF] Starting web server at : http://localhost:1841
[INF] ------------------------------------------------------------------
[INF] Waiting for changes...

所以你可以看到它修改了一些东西,现在我不再有问题了。现在我有另一个问题,我确定需要3天,就像这个......