日期:2014-05-16 浏览次数:20486 次
//1、第一步,通过function()构造对象
var SubClass = function() {
SubClass.superclass.constructor.call(this); //必须
};
//2、第二步,建立新对象与父类的继承关系
Ext.extend(SubClass, SupClass, {
newMethod : function() {},
overriddenMethod : function() {}
};
//1、第一步,声明一个对象并直接继承父类
com.ibeans.MainPanel = Ext.extend(Ext.Panel, {
id : 'ReportPanel',
region:'center',
//....
//2、重写父类函数initComonent()
initComponent : function() { //必须,
this.store = ds2;
this.cm = colModel2;
this.cm.defaultSortable = true;
com.ibeans.MainPanel.superclass.initComponent.call(this); //必须
//....
}
}