『ExtJS』01 001. ExtJS 4 类的定义
2012-11-23 16:06
169 查看
ExtJS 4 类的定义
类的定义与类方法的调用
样例代码3Ext.define('Cookbook.Vehicle', { Manufacturer : 'Aston Martin', Model : 'Vanquish', getManufacturer : function() { return this.Manufacturer; }, setManufacturer : function() { this.Manufacturer = value; }, resetManufacturer : function() { this.setManufacturer('Aston Martin'); }, applyManufacturer : function(manufacturer) { // perform some action to apply the value(e.g. update a DOM element return manufacturer; }, getModel : function() { return this.Model; }, setModel : function(value) { this.Model = value; }, resetModel : function() { this.setModel('Vanquish'); }, applyModel : function(model) { // perform some action to apply the value (e.g. update a DOM element) return model; }, getDetails : function() { alert(' ... ') } });
总结
使用Ext.define()方法定义类主要有三个部分:类配置部分,类方法,定义回调方法。ExtJS中,定义、实例化一个类时,直接使用字符串的命名的形式。
相关文章推荐
- 『ExtJS』01 001. ExtJS 4 类的定义
- 5、ExtJs——Ext基础架构--define定义一个类
- 001 线性代数之行列式:定义、逆序数、余子式与代数余子式、n个易算行列式、范德蒙行列式
- _00023 Kafka 奇怪的操作_001它们的定义Encoder达到Class数据传输水平和决心
- 01_Java基础_数组的定义、基本使用和简单应用
- Java千百问_01基本概念(001)_什么是Java
- 小甲鱼PE详解之IMAGE_DOS_HEADER结构定义即各个属性的作用(PE详解01)
- 小甲鱼PE详解之IMAGE_DOS_HEADER结构定义即各个属性的作用(PE详解01)
- 『ExtJS』01 004. ExtJS 4 确定函数的作用域
- 『ExtJS』01 009. ExtJS 4 方法重载
- 小甲鱼PE详解之IMAGE_DOS_HEADER结构定义即各个属性的作用(PE详解01)
- ExtJs——Ext基础架构--define定义一个类
- EXTJS 4.2 资料 控件lable定义
- 大整数算法[01] 大整数的表示和相关定义
- java学习001 Java与c中定义变量申请空间的理解
- 01创建表和定义数据完整性
- ElasticSearch学习_陶文4_【01】把 Elasticsearch 当数据库使:表结构定义
- Extjs 4.07 对类型定义引发的匹配问题
- ExtJS4.2 - 从 Hello World 到 自定义组件 -01 (为爱女伊兰奋斗)
- 小甲鱼PE详解之IMAGE_DOS_HEADER结构定义即各个属性的作用(PE详解01)