Ext UI组件 - Component, Button

这篇博客介绍了Ext中的Component基类及其构造方法、事件机制,并深入讲解了Button组件的封装、常用属性、方法及事件,展示了如何创建和定制Button。
摘要由CSDN通过智能技术生成

Component

 

在Ext中对常用的UI组件都进行了一系列的封装,而各个组件都具有一些相同的属性或者事件,这些相同的属性被封装起来成为Component类,每个UI组件都继承Component类,可见Ext在面向对象方面有很好的实现。看一下Component中的定义:

Js代码 
  1. //构造方法,传入config参数   
  2. Ext.Component = function (config){  
  3.     config = config || {};  
  4.     if (config.initialConfig){...};  
  5.     this .initialConfig = config;  
  6.     Ext.apply(this , config);  
  7.     this .addEvents(...);  
  8.     this .getId();  
  9.   
  10.     Ext.ComponentMgr.register(this );  
  11.     Ext.Component.superclass.constructor.call(this );  
  12.   
  13.     if ( this .baseAction){  
  14.             this .baseAction.addComponent( this );  
  15.     }  
  16.   
  17.     //初始化组件   
  18.     this .initComponent();  
  19.   
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值