How to Delete controller ExtJS? extjs多个app时,删除其他app的controller
来源:互联网 发布:网络销售门票协议书 编辑:程序博客网 时间:2024/06/06 13:02
ExtJs currently does not support removal of controllers out of the box. To cleanup a controller, do the following:
- Extend
Ext.app.EventBus
with a methoduncontrol
that unregisters all event listeners that this controller registered on the EventBus. Check out the source ofExt.app.EventBus#control
to derive an implementation. Or use this one. - Extend
Ext.app.Application
with a methodremoveController
that removes a given controller instance from thecontrollers
collection. It's a Ext.util.MixedCollection, check out the source forExt.app.Application#getController
. Then clean up all registered listeners for that controller usinguncontrol
. - Implement a
destroy
method either on your specific controller and/or extendExt.app.Controller
. You should at least callclearManagedListeners()
and possibly destroy other objects created by this controller like views or stores, if that suits your application architecture and controller life-cycle.
source:
Ext.override(Ext.app.EventBus,{uncontrol:function(controllerArray){var me=this,bus=me.bus,deleteThis,idx;Ext.iterate(bus,function(ev,controllers){Ext.iterate(controllers,function(query,controller){deleteThis=false;Ext.iterate(controller,function(controlName){idx=controllerArray.indexOf(controlName);if(idx>=0){deleteThis=true;}})if(deleteThis){delete controllers[query];}})})}})Ext.override(Ext.app.Application,{removeController:function(controllerArray){var me = this; me.eventbus.uncontrol(controllerArray);}})Ext.override(Ext.app.Controller,{destroy:function(){var me=this;this.clearManagedListeners();}})
0 0
- How to Delete controller ExtJS? extjs多个app时,删除其他app的controller
- ExtJS中app(controller,application)相关问题
- 如何更优雅的实现ExtJS的前端MVC模式下一个App多个Controller的动态加载
- 如何更优雅的实现ExtJS的前端MVC模式下一个App多个Controller的动态加载
- 如何更优雅的实现ExtJS的前端MVC模式下一个App多个Controller的动态加载
- extjs中Ext.app.Controller的init方法和onLaunch方法的执行顺序。
- extjs 调用controller 调用其他js文件
- Extjs controller/view/
- Ext.app.Controller
- 0101-APP-Alarm -controller
- LED controller APP
- Extjs创建多个controller实现多模块MVC动态加载
- How to debug EXTJS
- How to debug EXTJS
- How to overload a controller
- How to remove ActiveX Controller
- controller 使用的时候,ng-app 必须有名字
- 获取 APP 屏幕最上方的 View Controller
- LVS+keepalived搭建负载均衡学习手札(二)
- JsonParser
- Json与XML
- Android Studio的安装启动问题
- C语言基础——结构体
- How to Delete controller ExtJS? extjs多个app时,删除其他app的controller
- UIButton总结
- 巴菲特致股东的一封信:2010年
- 日志
- 替柴静说几句话--针对那些不做事的愤青
- 巴菲特致股东的一封信:2009年
- JavaScript(复习版一)
- [LeetCode]90.Subsets II
- Linux网络编程入门