ExtJs 继承的问题
基类的自定义对象需在构造函数中创建新实例。希望给刚刚使用ExtJs开发的兄弟提个醒,小走些弯路。
看代码注意标红处
Base类错误代码:
1: BaseWin = Ext.extend(Ext.Window, {
2: form: new myFormPanel(),
3: constructor: function() {
4: BaseWin.superclass.constructor.call(this, {
1: BaseWin = Ext.extend(Ext.Window, {
2: form:null,
3: constructor: function() {
4: this.form = new myFormPanel(),
5: BaseWin.superclass.constructor.call(this, {
子类代码:
1: insert_Win = Ext.extend(BaseWin,{
2: title:'添加数据'
3: });
4:
5: update_Win = Ext.extend(BaseWin,{
6: title:'修改数据'
7: });