使用如下继承方式:
MyDateField = Ext.extend(Ext.form.DateField, {
cache : {},
constructor : function(config) {
uft.extend.form.DateField.superclass.constructor.call(this);
}
});
var date1 = new MyDateField();
var date2 = new MyDateField();
date1.cache['a'] = 1;
理解原型链和引用就明白了,这种地方,在constructor里做this.cache = {};