Ext.Component事件
组件类提供了许多生命周期事件。当组件创建时,这些激活,渲染,销毁等等事件被激活。所有这些事件都可以通过使用监听器属性或使用on方法来进行处理。大多数这些生命周期事件实际上都是在ext.abstractcomponent类中定义的。下表描述了一些事件。

Ext.onReady(function() {
var panel = Ext.create("Ext.panel.Panel", {
renderTo: Ext.getBody(),
items: [
Ext.create("Ext.Component", {
html: "Raw Component",
itemId: "comp",
listeners: {
activate: function() {
console.log("acticate");
},
added: function () {
console.log("added");
},
afterrender: function () {
console.log("afterrender");
},
beforeactivate: function () {
console.log("beforeactivate");
},
beforedeactivate: function () {
console.log("beforedeactivate");
},
beforerender: function () {
console.log("beforerender");
},
beforeshow: function () {
console.log("beforeshow");
},
beforedestroy: function () {
console.log("beforedestroy");
},
destroy: function () {
console.log("destroy");
},
render: function () {
console.log("render");
},
show: function () {
console.log("show");
},
beforehide: function () {
console.log("beforehide");
},
hide: function () {
console.log("hide");
},
enable: function () {
console.log("enable");
},
disable: function () {
console.log("disable");
},
removed: function () {
console.log("removed");
}
}
})
]
});
console.log("******Calling disable");
panel.getComponent("comp").disable();
console.log("******Calling enable");
panel.getComponent("comp").enable();
console.log("******Calling hide");
panel.getComponent("comp").hide();
console.log("******Calling show");
panel.getComponent("comp").show();
console.log("******Calling destroy");
panel.getComponent("comp").destroy();
});
在上面代码中我们使用侦听器块注册了事件。在呈现组件之后,我们调用诸如启用、禁用、显示、隐藏或销毁这些方法来理解事件处理序列。这是这段代码的输出。

Ext.Component事件的更多相关文章
- 谈谈Ext JS的组件——组件基类:Ext.Component
概述 Ext.Component是所有Ext组件的基类,这在Ext.Component的API中第一句话就提到了.然后第二段说明了它包含的基本功能:隐藏/显示.启用/禁用以及尺寸控制等.除了以上这些基 ...
- ExtJS学习之路第二步:Ext.Component 和 Ext.dom.Element 的区别
让我们来初步的探讨下Ext.Component和Ext.Element的区别. jQuery偏重于DOM元素的操作 1.每一个HTML页面都有一个层次分明的DOM树模型,浏览器中的所有内容都有相应的D ...
- Extjs 继承Ext.Component自定义组件
//自定义HTML组件 Ext.define('MyCmp', { extend: 'Ext.Component', renderTpl: [ '<h1 class="title&qu ...
- [转载]Extjs中的dom,Ext.Element和Ext.Component对象的关系
原文地址:http://www.cnblogs.com/lwzz/archive/2011/01/30/1948106.html Ext.Element对象是对dom对象的封装,目的是为了跨平台以 ...
- 99.ext afteredit事件详解
转自:http://www.jcodecraeer.com/a/jquery_js_ajaxjishu/2012/0524/203.html 1 摘要 grid.on(afteredit,afterE ...
- Ext JS 5的声明式事件监听
在前文<在Ext JS 5使用ViewControllers>中,简单的介绍了Ext JS 5的一项重要改进——声明式事件监听.在本文,将深度探讨如何使用声明式事件监听啦简化应用程序的视图 ...
- spring boot: 一般注入说明(五) @Component, application event事件为Bean与Bean之间通信提供了支持
spring的事件,为Bean与Bean之间通信提供了支持,当一个Bean处理完成之后,希望另一个Bean知道后做相应的事情,这时我们就让另外一个Bean监听当前Bean所发送的事件. spring的 ...
- ExtJS关于组件Component生命周期
extjs组件生命周期大体分为3个阶段:初始化.渲染.销毁. 第一阶段:初始化 初始化工作开始于组件的诞生,所有必须的配置设定.事件注册.预渲染处理等都在此时进行. 1.应用组件的配置: 当初始化一个 ...
- 转: Ext拖拽分析
整个Ext架构中组件是其重要的组成部分,除了少部分(如树的结点)的界面表现元素不是在这样的一个体系中,大部分的页面表现元素都被绑定在这个体系之中,下面从这个体系的最底层即在这个继承体系的最高层进行研究 ...
随机推荐
- 表单的get和post使用情景
GET和POST两种方法都是将数据送到服务器,但你该用哪一种呢? HTTP标准包含这两种方法是为了达到不同的目的.POST用于创建资源,资源的内容会被编入HTTP请示的内容中.例如,处理订货表单.在数 ...
- 记一次调试串口设备Bug的经历
最近花了差不多1天的时间在折腾一个Bug,该Bug的表象如下: 这个Bug还特别独特,在开发电脑中无提示,在终端用户那里每次使用软件的时候都报这个.仔细思考了一下最近在源码中新添加的功能,没发现有啥特 ...
- 掌握Chrome Developer Tools:下一阶段前端开发技术
Tips 原文作者:Ben Edelstein 原文地址:Mastering Chrome Developer Tools: Next Level Front-End Development Tech ...
- oracle表的简单操作
版权声明:本文为博主原创文章,转载时请注明原文链接. 1.创建表 ) ) not null,primary key(num)); 创建了一个两个字段的表,num和name,都设置为非空,num设为主键 ...
- 动态分配数组(new)和用随机数赋值(rand)
#include <iostream>#include <ctime>#include <cstdlib>using namespace std; int main ...
- python 标准库 -- configparser
configparser 用于处理 ini 格式的配置文件, 其本质上是利用 open 来操作文件. 示例文件 : [zhangsan] name = zhangsan age = 12 job = ...
- 安装nginx+lua开发环境
一.安装nginx及搭建本地测试环境 1.创建安装目录: /data/nginx2.安装make: yum-y install gcc automake autoconf libt ...
- 360安全检测出的WordPress漏洞的修复方法
1.跨站脚本攻击(XSS) 这个漏洞注意是因为用户评论可以提交代码,有安全风险.虽然你的WordPress以及是最新版,但是你的WordPress主题却不一定跟着更新!因此,需要稍微修改一下评论相关的 ...
- 【解决】安装compass失败(gem install compass)
原始日期:2016-01-25 16:26 这个问题比较常见. 很多人在安装ruby后再使用gem install compass命令安装compass,发现安装失败. [解决方法:] / ...
- java 生产者 与 消费者的案例
主要理解了两个问题 1.线程数据同步的问题 2.线程交替运行的方式 package ThreadDemo; /** * 生产者与消费者的案例(一,同步的问题,值的问题 二,交替执行的问题) * @au ...