extjs class
来源:互联网 发布:博客数据库设计 编辑:程序博客网 时间:2024/05/29 12:17
Ext.onReady(function () {
Ext.define("My.test.Animal", {
height: 0,
weight: 0
});
Ext.define("My.test.Person", {
//普通子段
name: "",
//属性
config: {
age: 0,
father: {
name: "",
age: 0
}
},
//构造方法
constructor: function (name, height) {
this.self.count++;
if (name) this.name = name;
if (height) this.height = height;
},
//继承
extend: "My.test.Animal",
//实例方法
Say: function () {
alert("你好,我是:" + this.name + ",我今年" + this.age + "岁,我的身高是:" + this.height
+ "。我的爸爸是:" + this.father.name + ",他" + this.father.age + "岁。");
},
//静态子段,方法
statics: {
type: "高等动物",
count: 0,
getCount: function () {
return "当前共有" + this.count + "人";
}
}
});
function test() {
var p = Ext.create("My.test.Person", "李四", 178);
p.setAge(21);
p.setFather({
age: 48,
name: "李五"
});
p.Say();
Ext.create("My.test.Person");
alert(My.test.Person.getCount());
}
test();
});
Ext.define("My.test.Animal", {
height: 0,
weight: 0
});
Ext.define("My.test.Person", {
//普通子段
name: "",
//属性
config: {
age: 0,
father: {
name: "",
age: 0
}
},
//构造方法
constructor: function (name, height) {
this.self.count++;
if (name) this.name = name;
if (height) this.height = height;
},
//继承
extend: "My.test.Animal",
//实例方法
Say: function () {
alert("你好,我是:" + this.name + ",我今年" + this.age + "岁,我的身高是:" + this.height
+ "。我的爸爸是:" + this.father.name + ",他" + this.father.age + "岁。");
},
//静态子段,方法
statics: {
type: "高等动物",
count: 0,
getCount: function () {
return "当前共有" + this.count + "人";
}
}
});
function test() {
var p = Ext.create("My.test.Person", "李四", 178);
p.setAge(21);
p.setFather({
age: 48,
name: "李五"
});
p.Say();
Ext.create("My.test.Person");
alert(My.test.Person.getCount());
}
test();
});
- extjs class
- ExtJS xtype class对照表
- ExtJS xtype class对照表
- ExtJS xtype class对照表
- ExtJS xtype class对照表
- ExtJS xtype class对照表
- ExtJS xtype class对照表
- ExtJS xtype class对照表
- ExtJS xtype class对照表
- ExtJS 4 类系统(Class System)介绍
- ExtJS 4 类系统(Class System)介绍
- 关于extjs中的cls ≠ class
- ExtJS
- extJs
- ExtJs
- extjs
- ExtJS
- ExtJS
- UIButton上image和title的位置调整
- java学习笔记5 - Spring MVC 整合Velocity及用法说明
- Oracle GoldenGate for Oracle 11g(Solaris 10 x86-64) to Oracle 10g(CentOS 4.8) configuration
- Linux mv命令
- 一分钟掌握Spring中bean的生命周期
- extjs class
- C++ 学习书籍
- Error: unterminated string literal
- 提高显示布局文件的性能 1 - 优化布局层级
- Hadoop MR 实现视频拉流框架
- 对CentOS服务器上正使用MRTG进行移机操作
- Linux chown命令
- Git工具连接GitHub(Windows配置篇)
- Oracle RAC 11gR2安装的必要条件