java学习

java学习

 

Extjs解密1

/**
* Created by Administrator on 2017/3/24.
*/

var extend=function (c,f) {
c.prototype=f.prototype;
}
var f=function () {
this.a='aa';

}
f.prototype={
say:function () {
alert('f');
}
}
var c=function () {
this.b='aa';
}
extend(c,f);//只能继承prototype实现的方法
var c1=new c();
c1.say();


Ext.namespace('com.ext');
com.ext.First=function () {
var kiss='中国';

}
com.ext.First.prototype={
init:function () {
alert('init');
alert('kiss');
},
method:function () {
alert('method');
}
}
//var f=new com.ext.First();
//f.method();
com.ext.Second=function () {

}
Ext.extend(com.ext.Second,com.ext.First,{

method:function () {
alert('method2');
},
fun:function () {
alert('fun');
}
});
var s=new com.ext.Second();
s.method();
s.fun();
Student=function (config) {
this.a='3';
Ext.apply(this,config);
}
var st=new Student({a:'1',b:'2'});
alert(st.a);

Student1=function (config) {
this.a='3';
Ext.applyIf(this,config);
}
var st=new Student1({a:'1',b:'2'});
alert(st.a);
/**apply方法覆盖所有的属性
* applyIf不覆盖属性
*
*/



posted on 2017-03-24 17:52 杨军威 阅读(149) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 

导航

统计

常用链接

留言簿

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜