classes system in sencha touch
2024-10-19 12:46:27
//http://www.sencha.com/learn/sencha-class-system
var Person = new Ext.Class({
name: 'Mr. Unknown',
walk: function(steps) {
alert(this.name + ' is walking ' + steps + ' steps');
}
}); //http://docs.sencha.com/touch/2.2.1/#!/guide/class_system
//Ext.ns('My.sample');//define the namespace
Ext.define('Animal', { requires: [
'Ext.MessageBox'
], constructor: function(config) {
this.initConfig(config);
}, config: {
name: 'default name',
gender:'male'
}, speak: function() {
//alert('grunt');
Ext.Msg.alert(this.getName(), "Speaks...");
}, statics : { static1 :function(){
console.log('static fun1, called by Animail.static1');
}
}
}); console.log('launching...');
Animal.static1();
var ani=Ext.create('Animal',{name:'abc'});
console.log(ani.getName());
ani._name='zhaoyao';
console.log(ani.getName());
console.log(ani._gender);
ani.speak();
最新文章
- 学习ASP.NET MVC(五)——我的第一个ASP.NET MVC CURD页面
- Introducing shard translator
- 第二个Sprint冲刺第二天
- 使用jquery插件实现图片延迟加载技术(懒加载)
- angular事件代理
- POJ 1274 The Perfect Stall
- html5笔记
- python跟踪脚本进度(类似bash-x)
- SSM配置
- java自定义接口
- nutch-1.7-二次开发-Content中增加编码
- C/C++中define的使用
- POPTEST老李分享session,cookie的安全性以及区别 2
- 前端开发必备 40款优秀CSS代码编写工具推荐
- HDU1042N!大数的阶乘java模板
- Linux Doxygen的安装和使用
- 使用HAproxy如何实现web站点的动静分离
- EXCEPTION-javaBean
- EDT改成CST
- c#参数修饰符-out