我使用Ext.extend方法扩展了很少的ExtJS组件(Window,DataView等)。我想在扩展中添加一些额外的属性。如何将这些添加到我的组件中?
ExWindow = Ext.extend(Ext.Window,{
border:false,
initComponent: function() {
// Component Configuration...
var config = {
height: 500,
width: 500,
items: [{
xtype: 'simplepanel'
}]
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
ExWindow.superclass.initComponent.apply(this, arguments);
},
onRender:function() {
ExWindow.superclass.onRender.apply(this, arguments);
}
});
答案 0 :(得分:0)
ExWindow = Ext.extend(Ext.Window,{
border:false,
newPublicProperty: 0,
newPublicArray: new Array(),
initComponent: function() {
// Component Configuration...
var config = {
height: 500,
width: 500,
items: [{
xtype: 'simplepanel'
}]
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
ExWindow.superclass.initComponent.apply(this, arguments);
},
onRender:function() {
ExWindow.superclass.onRender.apply(this, arguments);
},
newPublicMethod:function() {
}
});
newPublicProperty,newPublicArray,newPublicMethod - 对象的新附加属性。