参考文章
Extjs创建多个controller实现多模块MVC动态加载
已实现了一个app加载多个controller的功能,
即点击左侧菜单栏,加载新模块的controller且下面的view store model等。
但是chrome会出现警告
该警告文字内容
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience.
查到有篇文章
关于chrome控制台警告:Synchronous XMLHttpRequest on the main thread终极解决办法
不明白为什么会出此问题,这个不是ext自动加载的吗?????最近比较忙,前几天分页就折腾了整整2天半,这个实在没时间研究了。
未解决******,先记录下来,以后再说
附代码
init:function(){
//init函数通过this.control来负责监听
this.control({
//被监听的组件别名
'menutree':{
//监听鼠标点击事件,点击后调用changePage方法
itemclick:this.changePage
},
});
},
changePage:function(view,rec,item,index,e){
var self = this;
var controllername = rec.data.controllername; //获取对应节点的控制器名字
var userController = application.getController(controllername); //警告****:Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
Ext.require(controllername,function(){//动态加载controller
userController.init(application);
},self);