Extjs event domain 研究
Listeners and Event Domains
In Ext JS 4.2, the MVC event dispatcher was generalized with the introduction of event domains. These event domains intercepted events as they were fired and dispatched them to controllers controlled by selector matching. The “component” event domain had full component query selectors while the other domains had more limited selectors.
With Ext JS 5+, each ViewController creates an instance of a new type of event domain called the “view” event domain. This event domain allows ViewControllers to use the standard listen and control methods while limiting their scope implicitly to their view. It also adds a special selector to match the view itself:
Ext.define('MyApp.view.foo.FooController', {
extend: 'Ext.app.ViewController',
alias: 'controller.foo',
control: {
'#': { // matches the view itself
collapse: 'onCollapse'
},
button: {
click: 'onAnyButtonClick'
}
}
});
The key difference between listeners and selectors can be seen above. The “button” selector will match any button in this view or any child view, irrespective of depth, even if that button belongs to a great-grandchild view. In other words, selector-based handlers do not respect encapsulation boundaries. This behavior is consistent with previous Ext.app.Controller behavior and can be a useful technique in limited situations.
Lastly, these event domains respect nesting and effectively “bubble” an event up the view hierarchy. That is to say, when an event fires, it’s first delivered to any standard listeners. Then, it’s delivered to its owning ViewController, followed by its parent ViewController (if any) on up the hierarchy. Eventually, the event is delivered to the standard “component” event domain to be handled by Ext.app.Controller-derived controllers.
http://wangyuelucky.blog.51cto.com/1011508/1610248/
Extjs event domain 研究的更多相关文章
- Javascript - ExtJs - 事件
事件(ExtJs Event) Ext.Util.observable类 Ext.Util.observable是一个接口,为Ext组件的事件提供了支持,组件的事件不同于传统事件,所以需要有这么一套 ...
- Android斗地主棋牌游戏牌桌实现源码下载
本次给大家分享下Android斗地主棋牌游戏牌桌实现源码下载如下: 为了节约内存资源,每张扑克牌都是剪切形成的,当然这也是当前编程的主流方法. 1.主Activity package com.biso ...
- Android --- 斗地主 [牌桌实现源码]
1.主Activity <span style="font-size:18px;color:#3333ff;">package com.bison; import an ...
- 《javascript高级程序设计》 第23章 离线应用与客户端存储
23.1 离线检测23.2 应用缓存23.3 数据存储 23.3.1 Cookie 23.3.2 IE 用户数据 23.3.3 Web 存储机制 23.3.4 IndexedDB 23.1 离线检 ...
- 《JavaScript高级程序设计》心得笔记-----第五篇章
第二十二章 1. 安全的检测是使用:Object.prototype.toString.call(value); eg: function isArray(value){ return Object ...
- HTML5分析实战Web存储机制(Web Storage)
Web Storage它是Key-Value在持久性数据存储的形式.Web Storage为了克服cookie把所引起的一些限制.当数据需要严格格控制client准时,没有必要不断地发回数据serve ...
- web storage 离线存储
用来保存键值对数据,数据以属性的方式保存在storage实例对象上 可以用storage1.length来决定键值对的数量,但是无法决定数据的大小,storage1.remainingSpace可 ...
- 数据存储之Web存储(sessionStorage localStorage globalStorage )
Web Storage 两个目标 提供一种在cookie之外的存储会话守数据的途径 提供一种存储大量可以跨会话存在的数据机制 最初的Web Storage规范包含两个对象 sessionStorage ...
- 【Linux】Cent OS 虚拟机开机自启动配置
一次断电,导致实体机关机了,虚拟机也连不上去,只好手动来起来. 我想增加一下自启动,让硬件开机的时候,自动启动虚拟机: 其实是有办法的,尝试了一下,也成功了,这里简单标记下. virsh autost ...
随机推荐
- Linux permission denied解决方法
一.准备 比如建立一个test.sh的脚本文件,脚本代码如下: #! /bin/bash echo Hello,world! 代码功能实现的是:输出字符Hello,world! 二.运行脚本 在终端切 ...
- webpack 配置
https://segmentfault.com/a/1190000009454172
- myeclipse编译弹框:The builder launch configuration could not be found
myEclipse 每次编译时报 "The builder launch configuration could not be found" 的弹框:不影响项目编译启动,但是弹框挺 ...
- TOP100summit:【分享实录-途牛】价格中心系统的优化之路
本篇文章内容来自2016年TOP100summit途牛旅游网高级架构师,技术委员会开发组长赵国光的案例分享.编辑:Cynthia 导读:价格中心系统是途牛网众多系统中很重要的一个,几乎所有的售卖价格计 ...
- Linux之文档与目录结构 目录的相关操作 Linux的文件系统
Linux之文档与目录结构 Linux文件系统结构 Linux目录结构的组织形式和Windows有很大的不同.首先Linux没有“盘(C盘.D盘.E盘)”的概念.已经建立文件系统的硬盘分区被挂载到 ...
- {django模型层(二)多表操作}一 创建模型 二 添加表记录 三 基于对象的跨表查询 四 基于双下划线的跨表查询 五 聚合查询、分组查询、F查询和Q查询
Django基础五之django模型层(二)多表操作 本节目录 一 创建模型 二 添加表记录 三 基于对象的跨表查询 四 基于双下划线的跨表查询 五 聚合查询.分组查询.F查询和Q查询 六 xxx 七 ...
- Python中的FTP通信模块ftplib的用法
Python中默认安装的ftplib模块定义了FTP类,其中函数有限,可用来实现简单的ftp客户端,用于上传或下载文件.FTP的工作流程及基本操作可参考协议RFC959. ftp登陆连接 from f ...
- [No0000C5]VS2010删除空行
VS2010删除空行,查找内容:^:b*$\n,替换为:,查找范围:当前文档,使用:正则表达式
- shell 文件描述符
/tmp/test.sh > /tmp/test.log 2>&1 这个命令的意思是 前半部分是将shell的输出重定向到/tmp/test/log.默认是标准输出(stdout文 ...
- [nginx] 从源码编译安装NGINX
nginx通过rpm包进行的安装和配置: [web][nginx] 初识nginx -- 使用nginx搭建https DPI解码测试环境 现在,要通过源码进行安装. 参考:https://nginx ...