This doesn't work:
Models.buttons.Del = Ext.extend(Ext.Button, { ,text: 'Del' ,listeners: { 开发者_如何学C load: function() { }, ,click: function() { } } });
Models.buttons.Add = Ext.extend(Models.buttons.Del, { ,text: 'Add' ,listeners: { ,click: function() { } } });
load() event be lost in Add object.
you can use superclass to not to lose those methods. by doing this, you can also extend methods.
Models.buttons.Del = Ext.extend(Ext.Button, {
,text: 'Del'
,listeners: {
load: function() {
},
,click: function() {
}
}
});
Models.buttons.Add = Ext.extend(Models.buttons.Del, {
,text: 'Add'
,listeners: {
load: function() {
Models.buttons.Add.superclass.load.call(this);
},
,click: function() {
}
}
});
精彩评论