首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

Ext.extend的应用

2012-10-30 
Ext.extend的使用function A(id){this.id id}//A.prototype.said function(){//document.write(id)/

Ext.extend的使用

function A(id){this.id = id;}//A.prototype.said = function(){//document.write(id);//}A.prototype = {said : function(){document.write(this.id);}}function B(id){B.superclass.constructor.call(this, id);}Ext.extend(B, A, {//重写父类的said方法said : function(){document.write(String.format("B:{0}", this.id));}});document.write("父类的said方法:");var obj1 = new A("obj1");obj1.said();document.write("<br/>子类重写父类的said方法:");var obj2 = new B("obj2");obj2.said();

热点排行